SimpleCart js - 在购物车中显示项目选项?

时间:2013-09-08 01:04:07

标签: jquery simplecart

对于我的生活,我无法弄清楚如何获得我为产品显示在购物车中的选项。他们通过Paypal很好!我花了一整天时间寻找答案(包括GitHub上针对simpleCart的所有问题)而且我被卡住了。

我只想让颜色和尺寸显示在购物车中。我设法在购物车中获得尺寸和颜色的标题,但我不知道我应该在哪里寻找实际数据。

这是我的HTML:

<div class="simpleCart_shelfItem">              
                    <h2 class="item_name"> MyPakage Weekday </h2>
                    <p> The first thing you put on to start your day should be a pair of these ultra comfortable MyPakage underwear. You'll thank us later. Put your most vital equipment in these premium underwear - no adjusting needed - and experience a new level of comfort. <br />
                    Features include:
                            <ul>
                            <li>Special blend of Modal and Spandex</li>
                            <li>Breathable and moisture-wicking (50% more than cotton)</li>
                            <li>Wrinkle free and shrink proof</li>
                            <li>Resistance to pilling from friction</li>
                            <li>Patented KeyHole comfort technology</li>
                            <li>No seams in critical areas</li>
                            <li>Seamless tag</li>
                            <li>Hand-stitched in critical areas</li>
                            </ul>
                    Note: For Charcoal/Orange, Seafoam/Orange, and Cobalt/Yellow there are no sizes 28-30 available. <br />
                    Size: <select class="item_size">
                        <option value="2830"> 28-30 </option>
                        <option value="3032"> 30-32 </option>
                        <option value="3436"> 34-36 </option>
                        <option value="3840"> 38-40 </option>
                    </select> <br />
                    Color: <select class="item_color">
                        <option value="Black Black Red"> Black Black Red</option>
                        <option value="Black Black Lime"> Black Black Lime</option>
                        <option value="Black Purple"> Black Purple</option>
                        <option value="Black Lime"> Black Lime</option>
                        <option value="Grey Blue"> Grey Blue</option>
                        <option value="Grey Yellow"> Grey Yellow</option>
                        <option value="White White Red"> White White Red</option>
                        <option value="Black Red"> Black Red</option>
                        <option value="Black Blue"> Black Blue</option>
                        <option value="Black Green"> Black Green</option>
                        <option value="White Red"> White Red</option>
                        <option value="White Black"> White Black</option>
                        <option value="Orange Charcoal"> Charcoal Orange</option>
                        <option value="Seafoam Orange"> Seafoam Seafoam Orange</option>
                        <option value="Cobalt Yellow"> Cobalt Cobalt Yellow</option>
                    </select><br>
                    Quantity: <input type="text" value="1" class="item_Quantity"><br>
                    Price: <span class="item_price">$25.00</span><br>
                <a class="item_add" href="javascript:;"> Add to Cart </a></p>

这是我的购物车栏目(给我标题值,就是它。)我知道我错过了抓取数据的部分,但我不知道在哪里/做什么。

cartStyle               : "table",
                cartColumns         : [
                    { attr: "name", label: "Name" },
                    { attr: "item_size", label: "Size" },
                    { attr: "item_color", label: "Color" },
                    { attr: "price", label: "Price", view: 'currency' },
                    { attr: "quantity", label: "Qty" },
                    { view: "decrement", label: false },
                    { view: "increment", label: false },
                    { attr: "total", label: "SubTotal", view: 'currency' },
                    { view: "remove", text: "Remove", label: false },

提前谢谢你。我的大脑被炸了!

1 个答案:

答案 0 :(得分:1)

尝试更改这些

{ attr: "size", label: "Size" },
{ attr: "color", label: "Color" },