Bigger Image in Vex Add to cart notification

  • Posts: 129
  • Thank you received: 0
7 years 10 months ago #273558

hi,
how can i change the size of the image loading in vex add to cart notification from 50px to 512px ?
i found this line of code :

content = "<div class=\"notifyjs-metro-base\"><div class=\"image\"><img src=\""+img_url+"\" width=\"50\" height=\"50\" alt=\"\"/></div><div class=\"text-wrapper\"><div class=\"title\">"+title+"</div><div class=\"text\">"+text+"</div></div></div>";
i guess i have to change the image url to a url of a bigger thumbnail.

thanks

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

  • Posts: 26233
  • Thank you received: 4035
  • MODERATOR
7 years 10 months ago #273567

Hello,

Unfortunately, it would require a bit more modification than that.
Why do you want to display such big image in your popup ?

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.

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

  • Posts: 129
  • Thank you received: 0
7 years 10 months ago #273583

i want to show the image in 128px and because i want to use retina support i have to load the original image at min 512 or 256px size !

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

  • Posts: 83799
  • Thank you received: 13570
  • MODERATOR
7 years 10 months ago #273589

Hi,

You would have to change the size in the line:

$img = $imageHelper->getThumbnail($image_path, array(50,50), array('default' => true), true);
of the file components/com_hikashop/controllers/product.php

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

  • Posts: 129
  • Thank you received: 0
7 years 10 months ago #273683

Thanks man it worked,
and how can I add a custom div inside "vex-content" div to load a custom content?

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

  • Posts: 26233
  • Thank you received: 4035
  • MODERATOR
7 years 10 months ago #273685

Hello,

Unfortunately, you cannot override the plugin JS file and if you modify it directly, your modification will be lost with the next update.
What I can recommend you is to make a copy of the plugin, with another name ; so you can modify it as you want and be sure that your plugin will stay the same with updates.
It requires some Joomla development skills but they have a good documentation for that :
docs.joomla.org/J3.x:Creating_a_Plugin_for_Joomla

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.

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

  • Posts: 129
  • Thank you received: 0
7 years 10 months ago #273776

okay, how can i modify it so please how i can add custom content at the end of the popup box!

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

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
7 years 10 months ago #273798

Hello,

You have to know that vex code doesn't depend on our work, it's not an HikaShop code file...
The aim to this topic is to help only on HikaShop, other extensions, plugins etc are off topic...
Even if that works with HikaShop, that's why Jerome give you a link.

Regards

Last edit: 7 years 10 months ago by Philip.

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

  • Posts: 129
  • Thank you received: 0
7 years 10 months ago #273894

Add to cart notifications are part of HikaShop Functionality,
if you decide to use another 3rd party extension or script instead of writing it from the base in HikaShop Core, that your call and decisions and it's okay.
but as a user, i think at least you can give support when a PAID user needs a customization hint on HikaShop Functionality.
Because you have decided to use another script like VEX instead of HikaShop Base, not user. and the user is familiar with HikaShop, not any script that u use.

I'm using your supports and hint for developing works on HikaShop. and I really count on it and want your support to always be the best.
That's why I think maybe it's better to write this post as a constructive criticism.

but, I get it!
Thanks :-)

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

  • Posts: 26233
  • Thank you received: 4035
  • MODERATOR
7 years 10 months ago #273901

Hello,

Nicolas gave you the line to modify the thumbnail size ; you found the line where the image is pushed in the JS and you can easily remove the "height" and "width" parameters.

My advice was to allow you to keep your modifications with updates.
If you modify HikaShop core files ; you are not able to update anymore...
The goal of our support is to give support, advice and allow you to continue to use HikaShop correctly in the future.

Afterwards, we can provide for sure support for HikaShop but we cannot provide it for third party libs ; even if they are used by HikaShop. The goal of these libs is to propose various solutions, more solutions that just libraries provided by the Joomla core (like "squeezebox" popup system).
We can help about a lot of things but what is deep customization or such kind of parts outside the limits of HikaShop, it's much difficult.
Constructive criticisms are welcome as long as they stay constructive.
And we do our best to always give constructives advice.

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.

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

  • Posts: 129
  • Thank you received: 0
7 years 10 months ago #274020

Thanks Jerome,
I've taken Nicolas Advice and fixed my height and width issue.
i was asking about adding custom content after check out or continue shopping button in vex pop up box,
you told me to make a copy of plugin in order to override it,
i just need to add a single custom line of content at the end of the pop up box,
i just wanted to know

1. Do I have to duplicate the vex notification plugin in order to make the modification?
or can I modify the current plugin? (assuming that I have no problem with backing up before update ! )

2. where can i insert my custom line of code in vex file? i want it to be shown at the bottom inside of the popup box.



and Thank you All Guys for your great help, advise and supports.
i'm really proud of you guys ! ;-)

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

  • Posts: 83799
  • Thank you received: 13570
  • MODERATOR
7 years 10 months ago #274023

Hi,

1. You can do it directly in the plugin. Making a copy of the plugin would allow you to update without having to reapply the changes.

2. in the file plugins/hikashop/cartnotify/media/notify-vex.js you have that code:

if(img_url == null) {
		content = "<div class=\"notifyjs-metro-lite-base\"><div class=\"text-wrapper\"><div class=\"title\">"+title+"</div><div class=\"text\">"+text+"</div></div></div>";
	} else {
		content = "<div class=\"notifyjs-metro-base\"><div class=\"image\"><img src=\""+img_url+"\" width=\"50\" height=\"50\" alt=\"\"/></div><div class=\"text-wrapper\"><div class=\"title\">"+title+"</div><div class=\"text\">"+text+"</div></div></div>";
	}
That's what creates the content of the vex popup so that's what you want to change.

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

  • Posts: 129
  • Thank you received: 0
7 years 9 months ago #275450

Thanks, one more thing about vex is that when i'm not logged in and i add a product into wish list it shows an error and says i have to loggin first
in the error of vex pop up instead of product image it loads this image in this condition: /media/com_hikashop/images/icons/icon-32-newproduct.png
how can i replace this image with product image like when i'm logged in and add a product to wish list ?


Thanks !

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

  • Posts: 83799
  • Thank you received: 13570
  • MODERATOR
7 years 9 months ago #275470

Hi,

The data sent back by the add to cart system when you click on an add to wishlist button while not being logged in doesn't contain the product information, only the error message.
That's why you get the generic icon.
If you want the image of the product, you would have to modify the code:

$ret = array(
					'ret' => 0,
					'message' => JText::_('LOGIN_REQUIRED_FOR_WISHLISTS')
				);
				echo json_encode($ret);
				exit;
in the file components/com_hikashop/controllers/product.php
However, that's more complex than changing the inside of the notification HTML since you need to load the product image data based on the REQUEST parameters, generate the thumbnail URL based on that, etc ...
The generation of the thumbnails and how to add it to the response can be seen in the getAjaxCartData function of the same file. Loading the product image data base be done with a MySQL query to the hikashop_file table.

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

  • Posts: 129
  • Thank you received: 0
7 years 9 months ago #275484

okay,
seems more complicated that what i was thinking,
so would you please tell me how to replace the 32x32px image with another 256x256px image ?

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

  • Posts: 83799
  • Thank you received: 13570
  • MODERATOR
7 years 9 months ago #275487

Hi,

You could replace directly the file /media/com_hikashop/images/icons/icon-32-newproduct.png
Or you could change the line :
'img_url' => HIKASHOP_IMAGES.'icons/icon-32-newproduct.png',
in the file plugins/hikashop/cartnotify/cartnotify.php in order to add instead the URL of your image.

The following user(s) said Thank You: nic7071

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

Time to create page: 0.083 seconds
Powered by Kunena Forum