Adding product name to Popup Notice?

  • Posts: 175
  • Thank you received: 0
9 years 5 months ago #236110

-- HikaShop version -- : -
-- Joomla version -- : -
-- PHP version -- : -
-- Browser(s) name and version -- : -
-- Error-message(debug-mod must be tuned on) -- : -

Hello

is it possible to add product's name into the popup notice?

imgur.com/Ah7mh3P

for example if i add product X, then the sign will says "Product X successfully added to the cart"

Thank You

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

  • Posts: 84309
  • Thank you received: 13701
  • MODERATOR
9 years 5 months ago #236138

Hi,

There is no option to do that.
And with custom code it won't be simple as you don't have the information in the popup.
That's actually something which should be easier to do with the new add to cart system that we're working on and that we plan on releasing with HikaShop 3.0
For now, you'll have to edit the file administrator/components/com_hikashop/helpers/cart.php and modify the javascript there to add the product id in the parameters of the URL of the popup notice. Then, you could edit the file "notice" of the view "checkout" and get that parameter from the $_REQUEST, load the product from the database and use its data to display its name.

The following user(s) said Thank You: veeco

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

  • Posts: 175
  • Thank you received: 0
9 years 5 months ago #236319

Hello, i tried to analyze the cart.php and i cant find the code that you mentioned

could you point out which line i should change?

Thank You

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

  • Posts: 84309
  • Thank you received: 13701
  • MODERATOR
9 years 5 months ago #236321

Hi,

It's that code which calls the display of the popup when the "Use AJAX when possible for add to cart buttons" setting of the HikaShop configuration is turned on:

$popupJs = '
							if(cart_type == "wishlist"){
								SqueezeBox.fromElement("hikashop_notice_wishlist_box_trigger_link",{parse: "rel"});
							} else {
								SqueezeBox.fromElement("hikashop_notice_box_trigger_link",{parse: "rel"});
							}
						';
There, you would have to add javascript code to modify the URL of the a tag with the id "hikashop_notice_box_trigger_link" and add the product id to it.
When the option is turned off, it's a bit more complex. You need to first add the product id as a parameter in the redirection javascript:
$js = 'window.location = \''.urldecode($url).'\';';
in the same file. Then, you would have to change the line:
SqueezeBox.fromElement(\'hikashop_notice_box_trigger_link\',{parse: \'rel\'});
in components/com_hikashop/views/product/view.html.php to add the parameter to the hikashop_notice_box_trigger_link a tag.

The following user(s) said Thank You: veeco

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

  • Posts: 175
  • Thank you received: 0
9 years 4 months ago #237108

Hello

I'm sorry but it seems i couldn't get it work

i already tried to modify and it just wont work

could you please explain it in step by step and more detail?

Especially the one without AJAX method turned on

Thank You

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

  • Posts: 84309
  • Thank you received: 13701
  • MODERATOR
9 years 4 months ago #237117

Hi,

Well, before the line
SqueezeBox.fromElement("hikashop_notice_box_trigger_link",{parse: "rel"});
you need to add a parameter in the URL of the a tag with the id hikashop_notice_box_trigger_link. That parameter must contain the product_id which is givent to the js function in one of the parameters.

That way, you'll have that parameter in the URL of the iframe popup and in the notice view file, you can just use that parameter to load the product and display what you want.

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

Time to create page: 0.039 seconds
Powered by Kunena Forum