- Posts: 256
- Thank you received: 2
Free products have a different button to addtocart
- dancingkazzaf
-
Topic Author
- Offline
Less
More
10 years 7 months ago #229849
by dancingkazzaf
Free products have a different button to addtocart was created by dancingkazzaf
-- url of the page with the problem -- :
176.32.230.249/clydesdale.net/
-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : Chrome
Hello,
I have my priced product display an add to cart button which they do, but then I want my free products to have a different button which can then link to a article page instead. Is it possible to tell the system that when a product is priced 'free' that it displays this other button.
Thanks
-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : Chrome
Hello,
I have my priced product display an add to cart button which they do, but then I want my free products to have a different button which can then link to a article page instead. Is it possible to tell the system that when a product is priced 'free' that it displays this other button.
Thanks
Please Log in or Create an account to join the conversation.
10 years 7 months ago #229886
by nicolas
Replied by nicolas on topic Free products have a different button to addtocart
Hi,
There is no option to do that.
First, what you can do is turn off the "display add to cart button for free products" setting of the HikaShop.
That way, you won't have the add to cart button for free products.
Then, you can edit the file "show_default" via the menu Display>Views and use such code:
There is no option to do that.
First, what you can do is turn off the "display add to cart button for free products" setting of the HikaShop.
That way, you won't have the add to cart button for free products.
Then, you can edit the file "show_default" via the menu Display>Views and use such code:
Code:
if(empty($this->element->prices)){
echo '<input type="button" value="Read more" onclick="window.location=\'http://mywebsite.com/my_other_page.html\';return false;"/>';
}
Please Log in or Create an account to join the conversation.
- dancingkazzaf
-
Topic Author
- Offline
Less
More
- Posts: 256
- Thank you received: 2
10 years 7 months ago #230198
by dancingkazzaf
Replied by dancingkazzaf on topic Free products have a different button to addtocart
Hello thankyou for the code, but I cant get it to display correctly.
Where abouts do I place the php code into show_default file and is there any more tags I needs around it to be read correctly.
Thanks
Where abouts do I place the php code into show_default file and is there any more tags I needs around it to be read correctly.
Thanks
Please Log in or Create an account to join the conversation.
- dancingkazzaf
-
Topic Author
- Offline
Less
More
- Posts: 256
- Thank you received: 2
10 years 7 months ago #230232
by dancingkazzaf
Replied by dancingkazzaf on topic Free products have a different button to addtocart
I have got it working now I had removed this \ from the end on the link.
Thankyou
Thankyou
Please Log in or Create an account to join the conversation.
- dancingkazzaf
-
Topic Author
- Offline
Less
More
- Posts: 256
- Thank you received: 2
10 years 7 months ago #230377
by dancingkazzaf
Replied by dancingkazzaf on topic Free products have a different button to addtocart
Hello, working on from my previous question can I do the same thing but place the button also on the product thumbnails?
Please Log in or Create an account to join the conversation.
10 years 7 months ago #230378
by nicolas
Replied by nicolas on topic Free products have a different button to addtocart
Hi,
Yes. Add that code in the file "listing_img_title" of the "product" view and replace in it $this->element by $this->row and it should work.
Yes. Add that code in the file "listing_img_title" of the "product" view and replace in it $this->element by $this->row and it should work.
Please Log in or Create an account to join the conversation.
Time to create page: 0.223 seconds