How to stop redirects? I found the file, but no problem

  • Posts: 34
  • Thank you received: 4
4 years 6 months ago #311198

-- HikaShop version -- : 402
-- Joomla version -- : 3.9.11
-- PHP version -- : 7.2

Why is it automatically redirected to the payment page when you click "Add to Cart" on the product page?
I only want to show the cart notification.
I disabled Redirect in the settings of the HikaShop Cart notification Plugin. But these settings only work on the Product List page. Still on the redirect product page.

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 6 months ago #311203

Hi,

If the add to cart is not done in ajax (it's possible if you have old view overrides in your template), or if the AJAX add to cart doesn't trigger the cart notification plugin's javascript (if there is a javascript error on the page), the add to cart will go in fallback mode and redirect to the checkout page so that it can display the success (or failure) message via the Joomla message system instead of the notify popup of the cart notification plugin.
We would need a link to a page with the issue to be able to say precisely what is the problem there.

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

  • Posts: 34
  • Thank you received: 4
4 years 6 months ago #311232

Hello. Yes. That's right. Hikashop html files in my template belong to version 3.5. I didn't update them.
Also these files have caused a drop down problem in my template. Java file formats do not work in Joomla! Jui folder.
My site is in local and I will post a link to you soon.

Last edit: 4 years 6 months ago by mrhossein.
The following user(s) said Thank You: Philip

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

  • Posts: 34
  • Thank you received: 4
4 years 6 months ago #311475

Hello
Dear friend
I removed all the HTML files from the template. The redirect problem was solved using the default files in version 4.0.1. I don't know which files to customize in the template I need to update. please guide me.

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 6 months ago #311477

Hi,

Well, I don't know which view file overrides you have in your template.
It's possible that it comes from the file quantity.php in the folder templates/YOUR_TEMPLATE/html/com_hikashop/layouts/ but it could also come from a file in the templates/YOUR_TEMPLATE/html/com_hikashop/product/ folder.
You should rename the files only by one in order to identify which view file is causing the problem.

The following user(s) said Thank You: mrhossein

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

  • Posts: 34
  • Thank you received: 4
4 years 6 months ago #311512

Hello.
This way I found a faulty file.
In the show.php file of line 427, from where it is written <!


Fancy TAB
> to the end, it prompts the product page after clicking the button Redirect purchase to payment page. When I removed this snippet of code, the notification plugin worked well and displayed the Add to Cart prompt.
These tabs display (Product Description), (Custom Fields), (Komento). In the last tab I was going to put the product files. But because of my lack of mastery of php, I failed to execute it.
Okay! I don't know exactly which part of the code caused the problem. That's why I attached this file along with product screenshots. Get help when possible.
Thank you.

Attachments:

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 6 months ago #311516

Hi,

Well, I don't know. I would need to analyse the situation on a page with the issue to be able to say more precisely.
Could you provide a link to such page ?

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

  • Posts: 34
  • Thank you received: 4
4 years 5 months ago #312507

Hello. This web address is now available. Please review.
Thank.
alamebartar.ir/products/p/%D8%AF%D8%A7%D...85%D8%B9%D8%A7%D8%B4

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 5 months ago #312519

Hi,

I'm not sure what is the problem as I'm not sure which button you're talking about or what the exact problem is.
All I can see is that if I click on the green button with the text "سفارش مرا هم اکنون ثبت کن!" I'm redirected back to the same page with the error message "تعداد مورد نياز براي اين محصول موجود نيست دانش مدیریت معاش" which apparently means that the product doesn't have enough stock available.
So I would recommend to check the settings of the product and if you don't see a problem, please provide screenshots of its settings (with the interface in English please).

The following user(s) said Thank You: mrhossein

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

  • Posts: 34
  • Thank you received: 4
4 years 5 months ago #312542

hi,

Hello.
Sorry. Unable to add to cart due to stock expiration. Product inventory modified. Please double check.
Images attached.

This page will be redirected to payment

Works on this page without problems

Attachments:
Last edit: 4 years 5 months ago by mrhossein.

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 5 months ago #312548

Hi,

I analyzed the situation on your links and the difference I see is that the jQuery.notify library is missing on the product page when the add to cart process is hapenning while it's still there on the other page which is working.
This usually indicates that there is some other extension's javascript redefining jQuery while the page is loaded resulting in the notify library being lost (that's the library used to display the popup notification and do the redirection or not).
Since it's missing, the add to cart javscript fall back to a standard checkout redirect so that the customer knows that the add to cart process worked.

Usually, in such situation, I recommend installing and setting up the extension jQuery Easy so that it can fix the way the jQuery library is being loaded.
Note that I see you have jchOptimize caching your javascript, so you might have to disable that caching or at least flush it after setting up the jQuery Easy plugin.
extensions.joomla.org/extension/jquery-easy/

The following user(s) said Thank You: mrhossein

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

  • Posts: 34
  • Thank you received: 4
4 years 5 months ago #312624

Hello.
Okay! Of course.
The tabs use the following file to upload jQuery. In fact, this piece of code at the end of the show.php file causes the tabs to function properly. I manually and with the plugin you mentioned removed the file and the notification issue was fixed, but the tab header color would not change anymore.

<script src=' cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js '></script>
<script src=' maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js '></script>

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 5 months ago #312645

Hi,

Well, I don't know how your tabs work so I can't say much more than what I already said.
I would recommend to use jQuery Easy instead of removing script tags from your tabs system. That might help avoid the issue with the header color not changing.

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

  • Posts: 34
  • Thank you received: 4
4 years 5 months ago #312754

Hello.
Unfortunately the plugin alone does not solve the problem. I tried different settings. The only way to remove jQuery scripts is to delete files.
Would you suggest a similar html source code to make tabs that are fully compatible with the notification plugin?

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

  • Posts: 81504
  • Thank you received: 13063
  • MODERATOR
4 years 5 months ago #312766

Hi,

Well, usually, I recommend to either just use the tabs system included in the tabular product page layout of HikaShop, as explained in the FAQ's "How to add a tab in the tabular view ?" section:
www.hikashop.com/support/documentation/106-faq.html#layo

Or to go with this Tabs extensions: extensions.joomla.org/extension/tabs/

So far, no one reported such issue with either solution.

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

Time to create page: 0.084 seconds
Powered by Kunena Forum