- Posts: 147
- Thank you received: 8
unpublishing a former default variant results in 404
1 year 10 months ago - 1 year 10 months ago #364469
by NicoW
unpublishing a former default variant results in 404 was created by NicoW
Hi, me again....what can i say 
I have a product and it has some variants, and the default variant is out of stock not coming back.
So when i et another variant as deafault that works.
If i unpublish the former default variant, it results in a 404 of the whole product page.
I tried doing mass actions canonical urls but that does nothing.
How do i solve this? i dare not delete the variant as then i could not solve the 404 issue.
Thanks
I have a product and it has some variants, and the default variant is out of stock not coming back.
So when i et another variant as deafault that works.
If i unpublish the former default variant, it results in a 404 of the whole product page.
I tried doing mass actions canonical urls but that does nothing.
How do i solve this? i dare not delete the variant as then i could not solve the 404 issue.
Thanks
Last edit: 1 year 10 months ago by NicoW.
Please Log in or Create an account to join the conversation.
1 year 10 months ago #364470
by nicolas
Replied by nicolas on topic unpublishing a former default variant results in 404
Hi,
I don't see why that would be the case. We would need to check the settings of the product and temporarily reproduce the issue. Could you provide a backend access via our contact form ?
www.hikashop.com/support/contact-us.html
I don't see why that would be the case. We would need to check the settings of the product and temporarily reproduce the issue. Could you provide a backend access via our contact form ?
www.hikashop.com/support/contact-us.html
Please Log in or Create an account to join the conversation.
1 year 10 months ago - 1 year 10 months ago #364491
by Philip
Replied by Philip on topic unpublishing a former default variant results in 404
Hello,
We have received your elements, but are unable to complete them, can you please complete them with this:
- The product affected by your problem previously described.
- Specify which variant will therefore remain at 0 stock (and will not return) in this product.
In order to precise our idea, we have explore your site, and wasn't able to see a 404 error by reaching product with variants, OR by select a variant with a 0 stock.
Guide us more in order to better understand the situation.
Regards
We have received your elements, but are unable to complete them, can you please complete them with this:
- The product affected by your problem previously described.
- Specify which variant will therefore remain at 0 stock (and will not return) in this product.
In order to precise our idea, we have explore your site, and wasn't able to see a 404 error by reaching product with variants, OR by select a variant with a 0 stock.
Guide us more in order to better understand the situation.
Regards
Last edit: 1 year 10 months ago by Philip.
Please Log in or Create an account to join the conversation.
1 year 10 months ago #364558
by NicoW
Replied by NicoW on topic unpublishing a former default variant results in 404
Hi,
You could not find the issue because i will not leave my site running with errors. this is after all the most important sales season of the year.
The product is called horizon, the variant is the 'White' 'WITH' variant which was the default variant until it run out of stock.
I have now replaced the image with an image explaining it will not come back.
If i disable the variant, the website gives an error.
BTW, the same happens if i add text in the description of the variant. (since you rebuild them to have separate boxes for description, specs, video, compare)
You could not find the issue because i will not leave my site running with errors. this is after all the most important sales season of the year.
The product is called horizon, the variant is the 'White' 'WITH' variant which was the default variant until it run out of stock.
I have now replaced the image with an image explaining it will not come back.
If i disable the variant, the website gives an error.
BTW, the same happens if i add text in the description of the variant. (since you rebuild them to have separate boxes for description, specs, video, compare)
Please Log in or Create an account to join the conversation.
1 year 10 months ago #364598
by nicolas
Replied by nicolas on topic unpublishing a former default variant results in 404
Hi,
Thanks for the details.
I was able to reproduce the issue by temporarily unpublishing the variant with a stock at 0.
That should indeed not happen. I'm not sure why it would.
Now, unpublishing the variant is the same as deleting it, so you could delete the variant and you should hopefully not have the same problem.
But to understand why this is happening, we'll need a FTP access in order to dig into the issue.
Could you provide it via our contact form ?
Thanks for the details.
I was able to reproduce the issue by temporarily unpublishing the variant with a stock at 0.
That should indeed not happen. I'm not sure why it would.
Now, unpublishing the variant is the same as deleting it, so you could delete the variant and you should hopefully not have the same problem.
But to understand why this is happening, we'll need a FTP access in order to dig into the issue.
Could you provide it via our contact form ?
Please Log in or Create an account to join the conversation.
1 year 10 months ago #364651
by nicolas
Replied by nicolas on topic unpublishing a former default variant results in 404
Hi,
I've spent a few hours trying to understand the problem.
I've narrowed it down to the line:
in the view file override product / show.
This is custom code which is not in HikaShop by default.
I've changed it to :
as it corresponds more closely to what is there by default in HikaShop:
and the error doesn't happen.
It doesn't help that you have a mechanism on your website which makes the page redirects to a custom 404 page whenever there is a PHP fatal error happening and I don't know how to deactivate that.
Ideally, you can look in the PHP error log of your server which should contain the fatal error message.
But my change seems to help so I guess the problem can be marked as solved.
I've spent a few hours trying to understand the problem.
I've narrowed it down to the line:
Code:
echo HTMLHelper::_('content.prepare', $html);
This is custom code which is not in HikaShop by default.
I've changed it to :
Code:
echo JHTML::_('content.prepare',$html);
Code:
<div id="hikashop_product_description_<?php echo $variant_name; ?>" style="display:none;"><?php
echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$variant->product_description));
?></div>
It doesn't help that you have a mechanism on your website which makes the page redirects to a custom 404 page whenever there is a PHP fatal error happening and I don't know how to deactivate that.
Ideally, you can look in the PHP error log of your server which should contain the fatal error message.
But my change seems to help so I guess the problem can be marked as solved.
Please Log in or Create an account to join the conversation.
1 year 9 months ago #364653
by NicoW
Replied by NicoW on topic unpublishing a former default variant results in 404
Thanks, i'll thry whatever happens after black friday sales.
I'll pass this discussion on to rcatheme as he makes a lot of templates for hikashop he can probably learn from this.
It's still strange though about adding text into a variant description resulting in the same error as disabling a variant. But whatever is fixed im happy about.
I'll pass this discussion on to rcatheme as he makes a lot of templates for hikashop he can probably learn from this.
It's still strange though about adding text into a variant description resulting in the same error as disabling a variant. But whatever is fixed im happy about.
Please Log in or Create an account to join the conversation.
1 year 9 months ago #364676
by NicoW
Replied by NicoW on topic unpublishing a former default variant results in 404
This is his reply, maybe this is for amongst you 2 as i have no idea:
echo HTMLHelper::_('content.prepare', $html); and echo JHTML::_('content.prepare', $html); are the same. Starting with Joomla! 4, JHTML has been replaced with HTMLHelper.
After applying the changes, was your issue resolved? Please confirm so I can check further if needed.
(i replied to him that i tested and the issue is indeed resolved)
echo HTMLHelper::_('content.prepare', $html); and echo JHTML::_('content.prepare', $html); are the same. Starting with Joomla! 4, JHTML has been replaced with HTMLHelper.
After applying the changes, was your issue resolved? Please confirm so I can check further if needed.
(i replied to him that i tested and the issue is indeed resolved)
Please Log in or Create an account to join the conversation.
1 year 9 months ago #364681
by nicolas
Replied by nicolas on topic unpublishing a former default variant results in 404
Hi,
I also agree with him that both should produce the same result. But on your website, that's not the case. Not sure why.
I also agree with him that both should produce the same result. But on your website, that's not the case. Not sure why.
Please Log in or Create an account to join the conversation.
Time to create page: 0.226 seconds