Products not showing up after import

  • Posts: 34
  • Thank you received: 0
2 years 3 months ago #338336

-- HikaShop version -- : 4.4.5
-- Joomla version -- : 3.10.4
-- PHP version -- : 8.0

Hi Team,

after a import of an older Hikashop version, a lot of products are not showing up in the front-end of the webshop.
Only when I open a product and hit the save button, then the product is showing up in the front of the webshop. I also tried to change the canonical URLs, but unfortunately without any success.

I currently have more than 2500 products active, so checking it manually isn't really an option.
Can you help me save these articles as a bulk action? Or do you have an PHP code that I can use within Products > Actions > Run PHP code ?

Thanks!

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

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
2 years 3 months ago #338337

Hi,

Well, a bulk action can be done with a mass action in System>Mass actions.
But before doing that, we need to understand why the products are not being displayed on the frontend.
For that, please check the hikashop_product table via your PHPMyAdmin and look at a product entry before and after you save it to see what is different.
From what you're saying, there is a chance that the issue comes from the product_type column not having the correct value (which should be "main") and saving the product via the interface would force that value again.
And in that case, a mass action with an action "update the values" on the column "product_type" with the "string" mode and the "main" text will solve the issue.
But without checking the data in the database, it's hard to say if it's really that or not.

The following user(s) said Thank You: war relics

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

  • Posts: 34
  • Thank you received: 0
2 years 3 months ago #338355

Hi Nicolas,

Thanks for your explanation.
I have looked at the database and the column "product_type" was neatly filled with "main" (this also with the products that are not being displayed on the frontend).
So to be sure I still did the Mass Action, but unfortunately this too was unsuccessful.

Now I have compared the products in the database that are and are not visible in the frontend. And what is striking is that the products where a save action still has to be performed, lack the "product_alias".

So is there a Mass Action that can be performed to fix this?

Thanks!

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

  • Posts: 4509
  • Thank you received: 611
  • MODERATOR
2 years 3 months ago #338361

Hello,

Can you process this test in order to check an idea, for us your current issue isn't linked to the product_alias, but in order to be sure :
Try to fulfill a product_alias in the hikashop_product table (via your phpmyadmin) in a non-worked product, and process a new test.

If your issue is still here, we will need to examinate a non-worked product datas, and so can you provide a products datas screenshot (always in your phpmyadmin).

Awaiting your elements to progress on your issue.
Regards

Last edit: 2 years 3 months ago by Philip.
The following user(s) said Thank You: war relics

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

  • Posts: 34
  • Thank you received: 0
2 years 3 months ago #338396

Hi Philip,

I just ran the test, adding the product_alias directly in the database (via phpmyadmin) to a non-worked product.
This has been successful!

After adding a product_alias to a non-working product, it is immediately visible in the frontend of the website, and works perfectly!

So I still need something like a Mass Action to fix this problem.
I've added a screenshot of the product details. This from a few even products.

Thanks!

Regards

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

  • Posts: 81513
  • Thank you received: 13068
  • MODERATOR
2 years 3 months ago #338404

Hi,

In that case, you can run a mass action with a filter on the product column "product_alias" = (empty input field), a second filter on "product_type" = "main", and an action "run PHP code" with the code:

$productClass = hikashop_get('class.product');
$product = $productClass->get({product_id});
$product->product_alias = $product->alias;
unset($product->alias);
$productClass->saveRaw($product);
That will add the correct alias in each product.

The following user(s) said Thank You: war relics

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

  • Posts: 34
  • Thank you received: 0
2 years 3 months ago #338417

Hi Nicolas,

Thanks for the help! The Mass Action with the php code did the job! :lol:
The database table product_alias was nicely filled, and everything works like it should be.

Thanks agian for all the help!

Regards

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

Time to create page: 0.069 seconds
Powered by Kunena Forum