add to wishlist button in module not working

  • Posts: 28
  • Thank you received: 2
7 years 2 months ago #276323

-- url of the page with the problem -- : lescomplementsnaturels.fr
-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.5
-- PHP version -- : 7.0
-- Browser(s) name and version -- : all
-- Error-message(debug-mod must be tuned on) -- : none

Hello,

The add to wish list button in the product page is working but not in the modules. Strangely (and hopefully) the add to cart button wich seems to use the same coding works in both the product page and the module.

Could you help me to get the add to wish list button in module working again?

This might be related to the joomla 3.7.5 upgrade,

Thanks,
Ph

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

  • Posts: 26146
  • Thank you received: 4026
  • MODERATOR
7 years 2 months ago #276332

Hello,

Which module are you talking about ?

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: 28
  • Thank you received: 2
7 years 2 months ago #276364

Hello,

Thank you for you reply.

I am using mod_hikashop. the problem also occurs when using category listing menu item.

both catégory listing and module are using the listing image and title div layout wich I have customized and attached. Also, I have surrounded in red the hear icon that is not working on the attached picture.

The cart icon works ok but not the heart

Thank you for your help.
Ph

Attachments:

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

  • Posts: 28
  • Thank you received: 2
7 years 2 months ago #276368

Please find below the code that is generated for those two buttons (cart and heart). I havent found yet which file is used to generate this


<div class="hikashop_product_stock">
<a rel="nofollow" class="hikashop_cart_button" href="#" onclick="var field=document.getElementById('hikashop_product_quantity_field_2');return hikashopModifyQuantity('2355',field,1,0,'cart',154)">ajouter au panier</a>
<input id="hikashop_product_quantity_field_2" type="hidden" value="1" class="hikashop_product_quantity_field" name="quantity">
<div id="hikashop_add_wishlist">
<a rel="nofollow" class="hikashop_cart_button" href="#" onclick="var field=document.getElementById('hikashop_product_quantity_field_2');if(hikashopCheckChangeForm('item',hikashop_product_form)){ var typeField = document.querySelector('form[name=hikashop_product_form] input[name=cart_type]'); if(typeField !== null){typeField.value = 'wishlist';} return hikashopModifyQuantity('2355',field,1,hikashop_product_form,'wishlist',154); } else { return false; }">ajouter à vos souhaits</a>
</div>
</div>

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

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
7 years 2 months ago #276503

Hi,

You're apparently using outdated view overrides.
And there is a bug in one of them as far as I can see.
I think that the issue either comes from the file "quantity" or "quantity_legacy" of the view "product" where you must have the line:

$formName = ',hikashop_product_form';
instead:
$formName = ',\'hikashop_product_form\'';
So please try changing that via the menu Display>Views and it should help.

The following user(s) said Thank You: Ph

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

  • Posts: 28
  • Thank you received: 2
7 years 2 months ago #276621

Thank you very much, I changed the line in the quantity legacy file and the wishlist button is working !
but now when I click on add to wish list from the product page it adds the product to the cart and not the wishlist... I will try to find what is going wrong and get back

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

  • Posts: 28
  • Thank you received: 2
7 years 2 months ago #276653

Hello,

When I revert the quantity legacy file to $formName = ',hikashop_product_form'; (wich seems to be the last version 3.1.1)
both the product pane wishlist icon and the module wishlist icon works on the product age but not the wishlist icon of module on the home page

When I put the quantity legacy file to $formName = ',\'hikashop_product_form\'';
both the product pane wishlist icon and the module wishlist icon do not work on the product age but the wishlist icon of module on the home page works

I have been playing around with the listing_img_title.php (for the mudole) the show_tabular.php (for the product page) and the quantity legacy files but did not succeed in having all wishlist icons to work.

Do you have an idea where I should look ?

Best regards,
Ph

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

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
7 years 2 months ago #276745

Hi,

Hard to say witohut being able to look at the issue. I still believe that the modification I proposed is neccessary.
However, I don't have the issue you're talking about on the product page when doing that on my end.
So there must be another issue in another view override on your end.
Could you provide a way of look at the issue on the product page (like a copy of the website in a subfolder or a test domain) ?

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

  • Posts: 28
  • Thank you received: 2
7 years 2 months ago #276753

Hello,

Thank you very much for your help. I will put the dev site up to date and send you the info to log in as an admin.

Great thanks,
Ph

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

  • Posts: 28
  • Thank you received: 2
7 years 2 months ago #276854

Hello,

I sent you the infor to log in the development site through PV.

The main files that I have overriden are show tabular and listing_img_title

sincerely,
Ph

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

  • Posts: 28
  • Thank you received: 2
7 years 2 months ago #277008

Hello,

The module uses the file templates/rnshop/html/com_hikashop/product/listing_img_title.php
The product page uses the file templates/rnshop/html/com_hikashop/product/show_tabular.php

What i cant figure is why the module add to wishlist button is woking on the product page but not on other pages also it use that same file (listing_img_title.php) on evry pages (working and not working pages).

Does anybody could help me to understand this ?

Thank you for your help,
Ph

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

  • Posts: 26146
  • Thank you received: 4026
  • MODERATOR
7 years 2 months ago #277319

Hello,

Since you're using the legacy add to cart and you have overrides which are based on old HikaShop views (and we don't know which versions), it's very complicated to understand and analyze the situation.
The patch that Nicolas proposed looks good regarding the current views, since the content can be used directly in some JS and there is no variable with the name..
You can see it directly in your website by clicking on the button you got the message

Uncaught ReferenceError: hikashop_product_form is not defined
So the patch would fix the issue we can see in your homepage.

Now, because the add to cart system had problems and couldn't evolved like we wanted, we made the new cart system in HikaShop 3. That system has been made to avoid the issue you're currently having (not more inline JS).

So my first advice would be to try to use the new HikaShop cart system.
And my second point would be to try to use the default HikaShop views in order to have a fixed context. Because you have customization we can't know what code you have and if you use the official content ; we could have that knowledge and know what is happening exactly.

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: 28
  • Thank you received: 2
7 years 1 month ago #279279

Hello,

I stil have not found any solution, how could I get some support ?

Thank you for your help

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

  • Posts: 82683
  • Thank you received: 13337
  • MODERATOR
7 years 1 month ago #279315

Hi,

So did you try to deactivate the "add to cart legacy" setting of the HikaShop configuration in order to use the new cart system like Jerome proposed ?
Also, updating to the new version of HikaShop might help.

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

  • Posts: 28
  • Thank you received: 2
7 years 1 month ago #279449

Hello,

"No" for checkout legacy did the job. All cart and wishlists button are ok now.

Thank you very very much for your time and expertise.
Ph

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

Time to create page: 0.079 seconds
Powered by Kunena Forum