Jump to content

[SOLVED] Add to Cart


overbags
 Share

Recommended Posts

Posted (edited)

I need the text to be on the "add to cart" button because many don't read the written reservation

I was thinking of creating an if in the <span> of the <button> "add to cart" type

if $ product-> quantity <= 0

book

else

Add to Cart

/ if

but with $ product-> quantity it gives me the total sum of the attributes of a product and not the quantity of the single attribute

Edited by overbags (see edit history)

Share this post


Link to post
Share on other sites

In /public_html/themes/default-bootstrap/js/product.js

function updateDisplay()
{
  //add
    if (quantityAvailable > 0) {
        $('#add_to_cart span').text('Add to cart');
    }  else {
        $('#add_to_cart span').text('Preorder');
    }
  //end add
  .....

 

Share this post


Link to post
Share on other sites

I modified the product.js file as indicated in the picture deleted cache etc etc but nothing happens

do I have to create an id at the span of the product.tpl file because it doesn't have it? you have to photo

Cattura2.JPG

Cattura.JPG

Share this post


Link to post
Share on other sites

  • overbags changed the title to [SOLVED] Add to Cart

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More