Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple prices in SimpleCartJs Shelf #521

Open
fstodulski opened this issue Aug 18, 2016 · 1 comment
Open

Multiple prices in SimpleCartJs Shelf #521

fstodulski opened this issue Aug 18, 2016 · 1 comment

Comments

@fstodulski
Copy link

fstodulski commented Aug 18, 2016

Hi,
I have a problem.
I 'm coding some website using AngularJs.
I want to display my product, which is in meny prices. The price depends on size.
So, for example I have a bucket of wings ( KFC ) in meny sizes.

This is my code:

<div class="product-content white-bg simpleCart_shelfItem" toggleClass ng-repeat="product in products">
    <div class="col-sm-7 col-xs-7">
        <div class="product-description">
            <p class="hidden">{{'{{product.id}}'}}</p>
            <h5 class="product-name pull-left item_name">{{'{{product.name}}'}}</h5>
            <p class="pull-left prod_desc">{{'{{product.description}}'}}</p>
            <p class="hidden">{{'{{product.category }}'}}</p>
        </div>

        <div class="add-product-container">
            <select class="select-product-type item_size white-bg  f-w-100" name="" id="">
                <option value="{{'{{p.price}}'}}" ng-repeat="p in product.options" class="text-center item_price">{{'{{p.price}}'}}</option>
            </select>

            <div class="actions">
                <a class="item_add" href="javascript:;">
                    <button class="action add-product green-bg"><i class="fa fa-plus" aria-hidden="true"></i></button>
                </a>
            </div>

        </div>
    </div>
    <div class="col-sm-5 col-xs-5 product-photo">
        <img src="{{ '{{product.photo}}'}}" alt="">
    </div>


</div>

The thing is, that - after adding new product to the cart script adds the whole option value
for ex.

24 48

in the cart it views 2448,0 instead of seperate 24 and 48.

Again, I use Angular Js to display my JSON data. SimpleCart works okey with names and quantity but it doesnt work with prices.

Any ideas how to do it?

@fstodulski
Copy link
Author

Nevermind i found a solution

<select class="item_price">
<option value="2.00">1 clip</option>
<option value="3.00">2 clips</option>
<option value="3.50">1 pince</option>
<option value="5.00">2 pinces</option>
</select>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant