Order variants in Cart

  • Posts: 61
  • Thank you received: 1
6 years 2 weeks ago #289526

-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.5
-- PHP version -- : 5.6.33
-- Browser(s) name and version -- : Chrome 64.0.3282.186
-- Error-message(debug-mod must be tuned on) -- : No error

The webshop of my client has 3 variants per product. Size, color and cup.
When selecting multiple products the outcome in the cart can be:
PrimaDonna Deauville BH: 85 E Natuur
PrimaDonna Deauville BH: 80 Caffé latte D

Notice that the order is probably alphabetical. But both should have Size, Cup and Color, like the first one.

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
6 years 2 weeks ago #289534

Hi,

In the specification area of your products you can choose the order you want for the characteristics:
monosnap.com/file/XDw0AjH6uSHV48akwQDC6Lh0XTIYcd
Regarding the order of the products in the cart, it is not alphabetically but based on the date you added the product to the cart.

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

  • Posts: 61
  • Thank you received: 1
6 years 2 weeks ago #289582

That's correctly set
https://ibb.co/b2Hj2x

The problem is within the same product.
Are you suggesting to delete all the variants and re-add them?

Last edit: 6 years 2 weeks ago by Digiwacht.

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

  • Posts: 4486
  • Thank you received: 609
  • MODERATOR
6 years 2 weeks ago #289610

Hello,

Strange...Can you provide an url link in order to process some test by ourself ?
In order to be sure you have to recreate the cart an re-add the product.
Awaiting news from you.

Regards

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

  • Posts: 61
  • Thank you received: 1
6 years 2 weeks ago #289613

I started off with an empty cart. Added 2 products:
digiwacht-klanten.nl/jasmijn/webshop/pro...madonna-deauville-bh
1 with 85, E, Natuur and
1 with 65, E, Caffé latte

The cart looks like:
https://ibb.co/dn8QAH

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

  • Posts: 4486
  • Thank you received: 609
  • MODERATOR
6 years 1 week ago #289627

Hello,

At the begin, we believe that the variant settings was the root issue and leads to generate automatically product + variant name, but we forget one point to check.
Can you check in your product variant tab the variant name as show on this screenshot :



Hope this will help you to get the root issue.
Regards

Last edit: 6 years 2 weeks ago by Philip.

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

  • Posts: 61
  • Thank you received: 1
6 years 1 week ago #289691

The name field is blank, so thats the root issue?
Shouldn't the variant names automagically fill the name fields?

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

  • Posts: 12953
  • Thank you received: 1778
6 years 1 week ago #289695

Hello,

Sure, it should automatically fill the good name for variants without name. It's also weird that you're only having that issue with the following product :
PrimaDonna Deauville BH: 65 E Caffé latte

Can you for the variant's name to "65 E Caffé latte" and test it again ? Thank you.

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

  • Posts: 61
  • Thank you received: 1
6 years 1 week ago #289886

Mohamed Thelji wrote: Can you for the variant's name to "65 E Caffé latte" and test it again ? Thank you.


What do you want me to do for the variant?

I see differences in other products as well. For instance the product Anita BH Safina. The order from the product shows Omvang, Cup, kleur and it displays as Omvang, kleur, Cup
https://imgur.com/a/RQJRg

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
6 years 1 week ago #289932

Hi,

I think I know what is the issue albeit I'm not able to reproduce it on my end.
Try to change the code:

						if(empty($mainCharacteristics[$product->product_id]))
							$mainCharacteristics[$product->product_id] = array();
						if(empty($mainCharacteristics[$product->product_id][$characteristic->characteristic_parent_id]))
							$mainCharacteristics[$product->product_id][$characteristic->characteristic_parent_id] = array();
						$mainCharacteristics[$product->product_id][$characteristic->characteristic_parent_id][$characteristic->characteristic_id] = $characteristic;

						if($product->product_type === 'variant') {
							if(empty($product->characteristics))
								$product->characteristics = array();
							$product->characteristics[] = $characteristic;
						}
to:
if($product->product_type === 'variant') {
							if(empty($product->characteristics))
								$product->characteristics = array();
							$product->characteristics[] = $characteristic;
						} else {
							if(empty($mainCharacteristics[$product->product_id]))
								$mainCharacteristics[$product->product_id] = array();
							if(empty($mainCharacteristics[$product->product_id][$characteristic->characteristic_parent_id]))
								$mainCharacteristics[$product->product_id][$characteristic->characteristic_parent_id] = array();
							$mainCharacteristics[$product->product_id][$characteristic->characteristic_parent_id][$characteristic->characteristic_id] = $characteristic;
						}
in the file administrator/components/com_hikashop/classes/cart.php
Let us know how it goes.
If that doesn't help, we'll need a backend and a FTP access to debug the issue on your website.

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

  • Posts: 61
  • Thank you received: 1
6 years 1 week ago #289955

That broke the site a bit.
I'll PM you the credentials

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
6 years 1 week ago #289969

Hi,

I've tested the code on my end before giving it to you. So it's not possible it will break the website unless you didn't do the exact modification I gave.

And I wasn't able to access your FTP server with the access you provided.
Please try again the modification and make sure you do exactly what I wrote in my previous message, without forgetting any curly braket or other.

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

  • Posts: 61
  • Thank you received: 1
6 years 1 week ago #289991

I tried it again, copy and pasted your code, but still breaks. I don't know what i am doing wrong.

I made a typo in the password. Thats corrected now.

Here the cart.php in a zip. Look at line 993, thats where it starts

File Attachment:

File Name: cart.zip
File Size:24 KB

Attachments:

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

  • Posts: 4486
  • Thank you received: 609
  • MODERATOR
6 years 1 week ago #290042

Hello,

For a reason I'm not able to connect via ftp... But I analyze your cart.php with your modification and I find maybe the error.
From your code, you have remove a condition :

if($product->product_id == $characteristic->variant_product_id) {
just after the
foreach($characteristics as $characteristic) {
it's around line 992 That may explain your error, you have to see this :
foreach($characteristics as $characteristic) {
					if($product->product_id == $characteristic->variant_product_id) {
/* Adjustment Nicolas */
						if($product->product_type === 'variant') {
							if(empty($product->characteristics))
								$product->characteristics = array();
							$product->characteristics[] = $characteristic;
						} else {
							if(empty($mainCharacteristics[$product->product_id]))
								$mainCharacteristics[$product->product_id] = array();
							if(empty($mainCharacteristics[$product->product_id][$characteristic->characteristic_parent_id]))
								$mainCharacteristics[$product->product_id][$characteristic->characteristic_parent_id] = array();
							$mainCharacteristics[$product->product_id][$characteristic->characteristic_parent_id][$characteristic->characteristic_id] = $characteristic;
						}
/* End Adjustment Nicolas */	

Screenshot review :



Hope this will help you to move forward.
Regards

Last edit: 6 years 1 week ago by Philip.

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

  • Posts: 61
  • Thank you received: 1
6 years 1 week ago #290055

Tnx. I missed that.
Unfortunately that didn't resolve the order problem.
https://imgur.com/a/6dT53

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
6 years 6 days ago #290137

Hi,

Ok, we'll have to check directly on your website.
WhenI try to access your FTP, I get the error:
U heeft geen toegang! Meer info: whitelist.host-ed.eu
I tried to add our office IP address there, and the website said that it was added.
However, I still can't connect to your FTP server.
Could you manually white list the IP address or deactivate the white list filter on your FTP server ?
If you need our IP address, please use our contact form to request it:
www.hikashop.com/support/contact-us.html

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

  • Posts: 61
  • Thank you received: 1
6 years 2 days ago #290232

I had contact with my provider. They claim the login attempt may have crossed the addition to the whitelist.
Your IP address is now on that whitelist, so can you try again?

Last edit: 6 years 2 days ago by Digiwacht. Reason: typo

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
6 years 1 day ago #290275

Hi,

Thank you for the access.
I was able to debug the issue and apply the necessary patch.
It's working fine on your website now and we'll include that on our end too.

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

  • Posts: 61
  • Thank you received: 1
6 years 1 day ago #290301

Tnx for checking. It's not entirely solved. The size is now shown twice.

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
6 years 22 hours ago #290314

Hi,

Thanks. I've added a second patch. Download the install package on our website and install it on yours to get that second patch too.

The following user(s) said Thank You: Digiwacht

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

Time to create page: 0.106 seconds
Powered by Kunena Forum