Skip to content

How to use "data" attribute? #95

@GaboDot

Description

@GaboDot

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions