Edit button Add to cart HTML link code

  • Posts: 317
  • Thank you received: 17
  • Hikashop Business
9 years 6 months ago #201775

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1

How or where to edit code, which i get with Add to cart html link button in product part.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
9 years 6 months ago #201862

Hello,
Can you tell me what do you exactly want to change on the Add to cart html link button so that I can give you more information on how to do it ?
Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 317
  • Thank you received: 17
  • Hikashop Business
9 years 6 months ago #201892

When i click "Add to cart HTML link" button, i get this code showing in popup

<a class="hikashop_html_add_to_cart_link" href="http://www.shop.com/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=5">Add to cart</a>

I want to customize that code. More precise, i want to add class btn-red. So admin dont need to change it every time.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 6 months ago #201895

Hi,

For the moment the generated code is directly in the HikaShop product controller.
So if you want to change that, you will need to modify the file (which is a core file so you will loose your modification next time you will update HikaShop).

File : administrator/components/com_hikashop/controllers/product.php
Code to edit

	function updatecart(){
		echo '<textarea style="width:100%" rows="5"><a class="hikashop_html_add_to_cart_link" href="'.HIKASHOP_LIVE.'index.php?option='.HIKASHOP_COMPONENT.'&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id='.JRequest::getInt('cid').'">'.JText::_('ADD_TO_CART').'</a></textarea>';
	}
This "update cart link" should be improved in the future but I can't say more for the moment.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: mojweb

Please Log in or Create an account to join the conversation.

  • Posts: 317
  • Thank you received: 17
  • Hikashop Business
9 years 6 months ago #201941

Thank you. This will do for the moment.

Please Log in or Create an account to join the conversation.

  • Posts: 28
  • Thank you received: 0
8 years 11 months ago #221796

Hi there !

This is exactely the answer to my question, but you posted this 6 month ago... Is there any new method or do I still have to modify the core file ?

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
8 years 11 months ago #221800

Hi,

It's still the same for now.

Please Log in or Create an account to join the conversation.

  • Posts: 317
  • Thank you received: 17
  • Hikashop Business
1 year 11 months ago #347605

After all years, any news on that?
I need to do some changes to that link and I think that others to.
Can at least be added rel="nofollow"?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #347608

Hi,

Indeed, this seems to have been lost.
I suppose that's because now people usually use the content tag mechanism ( www.hikashop.com/support/documentation/1...-product-insert.html ) which provides more functions like ajax add to cart, notification box, cart module refresh, etc like a normal HikaShop add to cart button while this uses the fallback add to cart mechanism.
We'll look into adding a view file for this for the next version so that you can easily change that with an override instead of that core file modification. It's an easy change so why not.

Please Log in or Create an account to join the conversation.

  • Posts: 317
  • Thank you received: 17
  • Hikashop Business
1 year 11 months ago #347627

We use this link in product descriptions. To insert second add to cart button at the end of the long description.
Thank you.

Please Log in or Create an account to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum