Show contact us button on product listing table next to add to cart

  • Posts: 4
  • Thank you received: 0
8 years 6 months ago #257611

-- HikaShop version -- : HikaShop Business: 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 5.6.22
-- Browser(s) name and version -- : Chrome Version 55.0.2883.87 m

HI ,
how would I go about adding ght e enquire button next to the add to cart button on the product or categiry listing page, I can add to the product item page but I would like to hhave it on the listing page as well, I am using a table to display the products.

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

  • Posts: 83993
  • Thank you received: 13605
  • MODERATOR
8 years 6 months ago #257616

Hi,

You can edit the file "listing_table" of the view "product" via the menu Display>Views and add such code:

			$params = @$this->params;
			global $Itemid;
			$url_itemid = '';
			if(!empty($Itemid)) {
				$url_itemid = '&Itemid='.$Itemid;
			}
			echo $this->cart->displayButton(
				JText::_('CONTACT_US_FOR_INFO'),
				'contact_us',
				$params,
				''.hikashop_completeLink('product&task=contact&cid=' . $row->product_id.$url_itemid),
				'window.location=\'' . hikashop_completeLink('product&task=contact&cid=' . $row->product_id.$url_itemid) . '\';return false;'
			);
after the code:
$this->setLayout('add_to_cart_listing');
							echo $this->loadTemplate();

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

  • Posts: 4
  • Thank you received: 0
8 years 6 months ago #257678

Hi Nicolas,
thank you for this it sort of works but whereever i place it it seems to either break or put it in the same column as the add to cart button so you are seeing the button twice.

Where exactly should I place it?

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

  • Posts: 83993
  • Thank you received: 13605
  • MODERATOR
8 years 6 months ago #257682

Hi,

As I said, you should place it after:

$this->setLayout('add_to_cart_listing');
echo $this->loadTemplate();
If you have an error when you do, please provide the error message and a screenshot of the code modification.

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

Time to create page: 0.063 seconds
Powered by Kunena Forum