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

How to use "data" attribute? #95

Open
GaboDot opened this issue Jul 12, 2017 · 0 comments
Open

How to use "data" attribute? #95

GaboDot opened this issue Jul 12, 2017 · 0 comments

Comments

@GaboDot
Copy link

GaboDot commented Jul 12, 2017

I've been looking for a solution, I need to store the product img url so I can retrieve it in the cart list with "{{ item.getData() }}", how can I achieve this?

I tried different ways but none of them worked

<div class="col-xs-6 col-sm-3"> <img ng-src="<?php echo site_url('/assets/product-img/2.jpg'); ?>" src="<?php echo site_url('/assets/product-img/2.jpg'); ?>" style="width: 3em;"/> <h4>My Item #1</h4> <p> $10.99</p> <ngcart-addtocart id="item1" name="My Item #1" price="10.99" quantity="1" quantity-max="5" data=img>Add to Cart</ngcart-addtocart> </div>

<div class="col-xs-6 col-sm-3"> <img ng-src="<?php echo site_url('/assets/product-img/2.jpg'); ?>" src="<?php echo site_url('/assets/product-img/2.jpg'); ?>" style="width: 3em;"/> <h4>My Item #1</h4> <p> $10.99</p> <ngcart-addtocart id="item1" name="My Item #1" price="10.99" quantity="1" quantity-max="5" data="item.img">Add to Cart</ngcart-addtocart> </div>

<div class="col-xs-6 col-sm-3"> <img ng-src="<?php echo site_url('/assets/product-img/2.jpg'); ?>" src="<?php echo site_url('/assets/product-img/2.jpg'); ?>" style="width: 3em;"/> <h4>My Item #1</h4> <p> $10.99</p> <ngcart-addtocart id="item1" name="My Item #1" price="10.99" quantity="1" quantity-max="5" data="img">Add to Cart</ngcart-addtocart> </div>

Any ideas would be helpful, thanks!

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