SimpleCart JS Cart图像未定义

SimpleCart JS Cart Image Undefined

本文关键字:未定义 图像 Cart JS SimpleCart      更新时间:2023-09-26

我是这里的新手,希望有人能帮忙。我正在使用simplecart,似乎无法显示购物车图像,购物车图像显示为未定义。我已经尝试了我在这里找到的所有建议的变通方法,但没有什么乐趣。

我的html标记:

<div class="simpleCart_shelfItem">
    <img src="images/clothingmens/1001.jpg" class="item-thumb">
    <p class="item_name"> Oneill Hoody</p><span class="item_price">&pound;59.00</span>
    <p><select class="item_size">
        <option value="0">Select Size</option>
        <option value="Small"> Small </option>
        <option value="Medium"> Medium </option>
        <option value="Large"> Large </option>
        </select></br>
    <a class="item_add" href="javascript:;"> Add to Cart </a></p>
                            </div>

我的Javascript:

            settings = {
                checkout                : { type: "PayPal", email: "removed" },
                currency                : "GBP",
                language                : "english",
                cartStyle               : "table",
                cartColumns         : [
                    {view:'image' , attr:'thumb', label: false},
                    { attr: "name", label: "Name" },
                    { attr: "price", label: "Price", view: 'currency' },
                    { attr: "size", label: "Size" },
                    { attr: "quantity", label: "Qty" },
                    { attr: "total", label: "SubTotal", view: 'currency' },
                    { view: "remove", text: "Remove", label: false }                
                ],

                shippingFlatRate        : 0,
                shippingQuantityRate    : 0,
                shippingTotalRate       : 0,
                shippingCustom      : null,
                taxRate             : 0,
                
                taxShipping         : false,
                data                : {}
            },

好的。哈哈。所以在你的图像标签

<img src="images/clothingmens/1001.jpg" class="item-thumb">

将"item_image"添加到类中。

<img src="images/clothingmens/1001.jpg" class="item-thumb item_image">

这应该能解决问题。祝你好运!

此外,我不确定,但你可能需要添加"拇指标签"

<img src="images/clothingmens/1001.jpg" class="item-thumb item_image" thumb="images/clothingmens/1001.jpg">

希望这能有所帮助!