- Posts: 2
- Thank you received: 1
change add to cart bottom
I want to know if you can change "Add to Cart" buttom, in order to be green when the availability of the item is so great, yellow when it is low, example when 10 pcs remaining, and red when the article is finished, but clicking it brings you to contact page
thanks for the reply
Please Log in or Create an account to join the conversation.
The easiest way is to use the contact button instead of the add to cart button in Configuration > Display, select "For all products" for the option "Display a contact button on the product page" and "No" for the option "Display 'add to cart' button".
Then edit the view "product / show_default" in HikaShop > Display > Views.
Replace the lines:
And in the view "product / quantity", replace:
And where the if condition is: "}elseif($this->row->product_quantity>0){" add the following code:
Then you have to create the properties for the new classes in HikaShop > Configuration > Display "Front-end default CSS" file.
Like:
Ps: you need the essential version for doing this.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The code given is to do all the changes, green button, yellow button and red button.
You have to create the properties for each button now.
To do that create the properties for the classes: ".greenButton" ".yellowButton" ".redButton" in the Frontend CSS File in HikaShop > Configuration > Display.
Please Log in or Create an account to join the conversation.
at me do not work the red button for the rest everything is ok, show the message "esaurito" in eng "over" but no one red button
this is the site:
www.resemagien.it/index.php?option=com_h...t=listing&Itemid=127
I also have a question, buying the business version I have to redo these steps?
sry for my english
Please Log in or Create an account to join the conversation.
Do you have enabled the "Contact" button for all products in the HikaShop configuration ?
And see if this option is enabled in the product edition page.
Buying the business edition will not erase the modifications, but you can make a save before upgrading.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
In HikaShop > Configuration > Display, the option "Display a contact button on the product page".
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
i now have business version and activated display button, but i don't see it, but I would like a red button to add products to cart, however, even if they are terminated
Please Log in or Create an account to join the conversation.
By default the contact us button is displayed only on the product page, not in the listing page.
But you can edit the view "product / listing_table" and try to add the code:
Please Log in or Create an account to join the conversation.
we have added to our list items ordered, I would create another type of button,
example, when the items are more than 10 put the green button, less than 10 yellow, then I thought of doing such a button "orange" for the items ordered, with the opportunity to add to the cart, and as the amount I could put "unlimited '
or accepted suggestions
Please Log in or Create an account to join the conversation.
You can use the same method as explained before, with some changes to change the color when ordered items.
The changes needs to be made in the view "product / quantity". Check if the customer already purchased the product, and change the color if it's the case.
It require good PHP knowledge.
Please Log in or Create an account to join the conversation.
green button and yellow button have an allignment, orange button have an other allignment, i tried to center it, without result, i tried to put:
but he center yellow and green, but not orange.hikashop_products .hikashop_product_stock .hikashop_cart_buttom {
margin-top: -35px;
}
i put a screenshot and the site is:
www.resemagien.it/index.php?option=com_h...t=listing&Itemid=179
to see class
I am going crazy to understand why

thanks
Please Log in or Create an account to join the conversation.
In the code I see:
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.