Error on order change

  • Posts: 61
  • Thank you received: 5
  • Hikashop Business
6 days 11 hours ago #366836

-- HikaShop version -- : 5.1.5
-- Joomla version -- : 5.3.0
-- PHP version -- : 8.4.5

Hi!

I have two isues in the order back system.

a) I configured my shop to the european decimal system. That means the divider is "." and the comma is "," - so nearly all inputs in the backend and the outputs in the frontend (or printings) are correct. But if I try to change an order via backend I have to use the english (american?) system. I guess this was overseen. ;-)

b) If I change an existing order in the backend (add new positions) the following happens:

1st: If I change the value in the tax list, the next field (price incl. tax) gets automatically the following content:

<HTML><HEAD><TITLE>403 Forbidden</TITLE><BASE href="/error_docs/"><!--[if lte IE 6]></BASE><![endif]--></HEAD><BODY><H1>Forbidden</H1>You do not have permission to access this document.<P><HR><ADDRESS>Web Server at getrankeheimdienst-chemnitz.de</ADDRESS></BODY></HTML><!-- - Unfortunately, Microsoft has added a clever new - "feature" to Internet Explorer. If the text of - an error's message is "too small", specifically - less than 512 bytes, Internet Explorer returns - its own error message. You can turn that off, - but it's pretty tricky to find switch called - "smart error messages". That means, of course, - that short error messages are censored by default. - IIS always returns error messages that are long - enough to make Internet Explorer happy. The - workaround is pretty simple: pad the error - message with a big comment like this to push it - over the five hundred and twelve bytes minimum. - Of course, that's exactly what you're reading - right now. -->


2nd: If I deleted the HTML code from above and type in a number, I get two errors in the product list (backend -> screenshot):


error 1: Warning: Attempt to read property "pfand" on null in /var/www/vhosts/path_to_website/administrator/components/com_hikashop/views/order/tmpl/show_products.php on line 191

error 2: Warning: Attempt to read property "product_parent_id" on null in /var/www/vhosts/path_to_website/administrator/components/com_hikashop/views/order/tmpl/show_products.php on line 196

And the values of the manual added position (Rückpfand) shown in the product table are totally weird. I typed in "3.75" - not "403".

Maybe here is a guess ... is it possible that the custom fields (in my case "pfand") are not integrated in the "edit order" feature in the backend? If I add a new position to the order (via backend) no custom field is shown. In my case: I can not add values for the custom field (in my case "pfand" -> means "bottle deposit").

So ... it would be important to have these fields editable.

Attachments:
Last edit: 6 days 10 hours ago by Rusty.

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

  • Posts: 83674
  • Thank you received: 13545
  • MODERATOR
6 days 5 hours ago #366842

Hi,

a. Which inputs are affected ?

b.
1st. What do you mean by "If I change the value in the tax list, the next field (price incl. tax) gets automatically the following content:" ?
The tax list of what ?

2nd. If I remember correctly, pfand is a custom field of the table "product" on your website.
Are you saying that you're trying to add a tag of that custom field in the price field of a product of an order ?
That's not possible. You can only enter a number there.
The price calculations and cart fee plugins can only process formula tags on the product page on the frontend and the cart on the frontend. They don't do anything for orders.
And more than that. Pfand is a custom product field. It is linked to the product. It is not linked to the product in the order.
If you want to change it for a product, you need to edit the product.
Only custom fields of the table "item" are linked to products in orders because they are normally set by the customer on the product page on the frontend.

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

  • Posts: 61
  • Thank you received: 5
  • Hikashop Business
6 days 4 hours ago #366851

Hi,

nicolas wrote: And more than that. Pfand is a custom product field. It is linked to the product. It is not linked to the product in the order.
If you want to change it for a product, you need to edit the product.
Only custom fields of the table "item" are linked to products in orders because they are normally set by the customer on the product page on the frontend.


Uh ... I guess I don't get it.
A custom field of type "product" can NOT be used in the checkout process, the order? What are we talking about ... since weeks? :blink: I asked for a solution to create some type of deposit. And ... it's clear that this has to be used all over the product presentation AND the order process. Otherwise it makes no sense.

I do not see the problem. Currently I CAN use the custom field for the product page AND the checkout / order. Only if I try to change an existing order via backend we get problems. I think, the only thing we need is the custom fields in the order edit screen.

If not with custom fields - how else should you set up a deposit solution?
I'm pretty confused right now.

Last edit: 6 days 4 hours ago by Rusty.

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

  • Posts: 83674
  • Thank you received: 13545
  • MODERATOR
5 days 16 hours ago #366854

Hi,

Well, I'm pretty confused as well.

The solution I proposed is in 3 steps:
- you have a custom product field in each product, where you can specify a deposit value
- you have the cart fee plugin which sums the deposit value of each product in the cart and adds it as an extra fee to the cart
- HikaShop will convert the cart to an order at the end of the checkout, and the extra fee will be displayed in the additional information area of the order.
Until you opened this new thread on our forum, I believed that this solution met all your needs for a deposit capability.

There is no mechanism in HikaShop at the moment to be able to edit the extra fees linked to an order. No one requested that capability so far. And you didn't mention as something you would need to be able to do either, so I didn't even consider this as something that would be needed.

So I don't understand what you're trying to edit in the order interface, nor how you get these errors since there is no interface to be able to edit the extra fee.
You're talking about changing the value of the custom product field in the order, but that doesn't make sense. The custom product field is linked to the product, not the order. It's the extra fee which is linked to the order.

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

  • Posts: 61
  • Thank you received: 5
  • Hikashop Business
5 days 16 hours ago #366860

Hi nicolas,

maybe I did not make it clear enough. Even if I do not want to change custom field values in an existing order, I can not change the order itself - it causes errors BECAUSE the custom field is missing, I guess (in the edit screen). I made a little screencast to show the errors (attached).

Cheers

Attachments:

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

  • Posts: 83674
  • Thank you received: 13545
  • MODERATOR
5 days 11 hours ago #366862

Hi,

Thanks for the screencast, that helps.
So the error happens when you're trying to add a new order product to an order. That's something you had not mentioned, but it is a crucial information in order to understand what we're talking about.

I understand the first error happens when you're trying to change the tax rate selection in the new product popup.
That error is not linked to having or not the custom field on that form contrary to what you're saying.
I'm not sure why you get that error since I don't have it on my end.
I would need a backend access AND a FTP access in order to check on the issue.

There are a few issues with what you're doing :
- the "pfand" is a custom field linked to products. If you need to provide that value, it needs to be done when creating a normal product in the Products menu, not in a order. Here you're not adding a new product, but an order product. When HikaShop creates a new order, it will create an order product entry for each product in the cart. This way, if you change a product in the future, the information from that product won't be changed in previous orders. And order product doesn't have product custom fields. It has instead custom fields of the table "item". So, it is normal there is no pfand field in that popup.
- Now, you might think that a solution to circumvent this would be to create a normal product in the Products menu, and then use the "select" button instead of the "new" button of the order products listing to select that product. That way, you could enter the pfand value in the product before adding it to the order as an order product. However, as I said in a previous message, the cart fee plugin doesn't do anything with orders. So, the cart fees added by the plugin won't be recalculated after you add that new order product, even if a product with a pfand value is selected to be added as an order product.
- To be able to update the fees of an order would require an extra interface added to HikaShop. At the moment, once a fee is added to cart and the cart is converted into an order, the fee can't be changed.

You didn't tell me why you're trying to add a new order product to an existing order. Is that something you'll have to do normally ?
Do you need to be able to add new order products to an order ? Do you need them to have a pfand value ? Do you need to subsequently update the cart fee ?
The errors you got might actually not be relevant to what you're trying to achieve.

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

  • Posts: 61
  • Thank you received: 5
  • Hikashop Business
5 days 11 hours ago #366865

Hi,

nicolas wrote: I understand the first error happens when you're trying to change the tax rate selection in the new product popup.
That error is not linked to having or not the custom field on that form contrary to what you're saying.
I'm not sure why you get that error since I don't have it on my end.
I would need a backend access AND a FTP access in order to check on the issue.


Okay, will send it via your form.

nicolas wrote: There are a few issues with what you're doing :
- the "pfand" is a custom field linked to products. If you need to provide that value, it needs to be done when creating a normal product in the Products menu, not in a order. Here you're not adding a new product, but an order product. When HikaShop creates a new order, it will create an order product entry for each product in the cart. This way, if you change a product in the future, the information from that product won't be changed in previous orders. And order product doesn't have product custom fields. It has instead custom fields of the table "item". So, it is normal there is no pfand field in that popup.
- Now, you might think that a solution to circumvent this would be to create a normal product in the Products menu, and then use the "select" button instead of the "new" button of the order products listing to select that product. That way, you could enter the pfand value in the product before adding it to the order as an order product. However, as I said in a previous message, the cart fee plugin doesn't do anything with orders. So, the cart fees added by the plugin won't be recalculated after you add that new order product, even if a product with a pfand value is selected to be added as an order product.
- To be able to update the fees of an order would require an extra interface added to HikaShop. At the moment, once a fee is added to cart and the cart is converted into an order, the fee can't be changed.


Okay, thanks for your clarification. I understand the difference between product in shop frontend and ordered product in backend.

nicolas wrote: You didn't tell me why you're trying to add a new order product to an existing order. Is that something you'll have to do normally ?
Do you need to be able to add new order products to an order ? Do you need them to have a pfand value ? Do you need to subsequently update the cart fee ?
The errors you got might actually not be relevant to what you're trying to achieve.


Yes, we would daily (!) change/add "order products" as we take deposit packages from the clients back. Workflow is: customer is purchasing - we delivering - customer give deposit package back - we make credit note on his order (add new "order product" with negative value) - print invoice - and send it to the customer.

BUT ... as a possible workaround ... maybe it would be a simple solution if we could add a simple "order product" as credit note ... we could name it "pfand". Btw. this is what I tried to achive as I faced the errors I showed you in the screencast.

Last edit: 5 days 11 hours ago by Rusty.

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

  • Posts: 83674
  • Thank you received: 13545
  • MODERATOR
5 days 7 hours ago #366867

Hi,

Great. We're getting on the same page. I now have a clearer understand on your situation and where we need to go.
I'll wait for the FTP access to be able to check your situation with the errors linked to the new order product popup. That's something I should be able to fix.

I'm not sure adding an order product to the order will help you do what you want.
From what I understand, if you have an order with a product costing 100€ and a shipping fee of 50€ and a deposit fee of 200€, the total amount will be 100 + 50 + 200 = 350€. The subtotal amount will be 100€.
If the customer pays the deposit fee of 200€, the subtotal amount would have to be -100€. I'm not sure if the system allows for it. And that might look strange.

An alternative might be to add the deposit fee as a coupon in the "additional information" popup of the order. I would recommend testing this as a possible solution ?

Another solution would be to create a custom field of the table "order" with the name "amount paid by the customer" and another one with the name "amount paid taken into account" for example. That way, in the "additional information" popup of the order, you could enter the amount paid by the customer.
And, for it to apply to the total amount, you could create a mass action with the trigger "after an order is updated", a filter on the "amount paid by the customer" column being greater than 0, a filter on the "amount paid taken into account" column being smaller than 1, an action "update the values" on the "order_full_price" with the "operation" mode and the value order.order_full_price-order.xxx where xxx is the column name of the "amount paid by the customer" column, and an action "update the values" on the "amount paid taken into account" column with the "int" mode and the value "1".
That way, the first time you enter the amount in the custom order field, the total amount would get its value reduced by the amount you provided, and subsequent saves of the order wouldn't change that.
However, this is a bit clunky as if you add later on another product, or change the shipping fee or something else which requires recalculating the total amount of the order, the amount in that custom order field won't be taken into account.

Ideally, being able to add extra fees to orders, and modify existing fees would be a nice addition to HikaShop in the future. That would make for a nicer solution with a lot of potential. However, this requires quite a bit of development on our end.

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

  • Posts: 61
  • Thank you received: 5
  • Hikashop Business
4 days 16 hours ago #366877

Hi,

nicolas wrote: I'll wait for the FTP access to be able to check your situation with the errors linked to the new order product popup. That's something I should be able to fix.

Sent it. Good luck!

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

  • Posts: 61
  • Thank you received: 5
  • Hikashop Business
3 days 9 hours ago #366884

Hi nicolas,

because we talked in two threads about similar things, I will only continue writing in this thead.

In the meantime I had an idea, that's in my mind since this weekend: Would it be possible the create a simple "link feature"?

What does it mean?
I could imagine to "link" a product to another, so that we have a "base product" and a "sub product". It's something like a bundle but with a special feature.

How does it work?
If I put the base product in the cart, the sub product will automatically be added to the cart - and with the same quantity like the base product (because it's linked).

We would need only one additional feature: "Link product to ..."

In this case we had only advantages - and no disadvantages:
> because both products would be "real" products - all displays/views would use the normal system
> all tax calculations would be "default" - because every product contains the "default tax system"
> we do not have to change any view (manually), because - actually we put "two" products in the cart (so no changes to email, order views, invoice etc.)

What do you think?

Cheers
Rusty

Last edit: 3 days 9 hours ago by Rusty.

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

  • Posts: 83674
  • Thank you received: 13545
  • MODERATOR
2 days 17 hours ago #366889

Hi,

Great.
1. I was able to access your website and do some debugging and add fixes for the problems with adding new products to orders.
These were caused by the tax rate namekey which has special characters and how your server is setup which blocks the request to update the calculated price instead of letting it go.
I've added the fixes to your website with the FTP access and confirmed they fix the problems.
I've also added them on our end. For anyone with the issue, you can download the install package of HikaShop on our website and install it on yours to get the patches, which will also be included automatically to the next version of HikaShop. So, if you're reading this in the future, and already have HikaShop 5.1.7 or higher, you already have the patches mentioned here and your problem is probably different.

2. That's indeed an interesting alternative.
You could do that with the options system:
www.hikashop.com/support/documentation/i...ct-form.html#options
You would have to :
- create an unpublished category (to put your option products in there, so that customers can't purchase them on their own).
- create a characteristic with only one value via the Products>Characteristics menu
- create an option product in that unpublished category for each product of your shop. In it, you'll want to select that chracteristic in the "characteristics" area, and then, under the "variants" tab, you want to add a variant for the only value of the characteristic.
- in either the variant, or in the product, you can enter the price of the deposit as a normal product price.
- Finally, add the created product in the unpublished category to the "options" setting of the main product.
This way, on the product page of that main product on the frontend, you'll see a new dropdown with only one choice (so it will be a mandatory option, not an optional option :) ), and when the user adds the product to the cart, it will add automatically both the main product and the option product to the cart.

One thing you don't want is for the customer to be able to remove the main product from the cart, without the corresponding option to be removed, or to change the quantity of the product in the cart, without the quantity of the option to change.
There are two ways to go about this:
- The simplest is to make sure the "group options with product" setting of the HikaShop configuration is turned on. This way, the system will automatically group the product with its option(s) in the cart / order. That's easy, but I don't know if the displayed result will be good enough for what you want to do.
- Another option is keep the "group options with products" setting turned off and instead to configure the "cart" view of your checkout workflow in the HikaShop configuration page to turn on its "read only" option and to configure your cart module via the Joomla modules manager to deactivate the quantity and delete. This way, the option will display as an extra product of the cart, but the customers won't be able to change the quantities of the products in the cart directly. They'll have to add the product to the cart again if they want to add more quantity to their product in the cart. And if you want them to be able to clear their cart, you can add a "clear cart" button : www.hikashop.com/forum/4-how-to/14276-empty-cart-button.html But it requires a view override.
This second solution is a bit more complex to setup and to use for the customers, but it might display more closely to your needs.

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

  • Posts: 61
  • Thank you received: 5
  • Hikashop Business
2 days 13 hours ago #366893

Hi nicolas,

thanks for the tips. It seems working ... have to check it further.

Attachments:
Last edit: 2 days 12 hours ago by Rusty.

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

  • Posts: 61
  • Thank you received: 5
  • Hikashop Business
1 day 15 hours ago #366900

Hi nicolas,

thanks again for your help. I checked this out and played a little bit.
Unfortunately none of the two "workarounds" for avoiding the user to change the options quantity is good.

Option A: The issue here is, that the cart only shows the total product price (incl. options). But this is not allowed in germany. We have display every single price part. In addition, the option price is only shown as a single price - even if the main product has a higher quantity in the shopping cart.

A solution here would be if the "single price" of the main product would be shown without options AND the displayed options would be display the total sum of options price. Means - if the main product has a quantity of 10, then the total sum of options price also should be displayed as x10.
The total of the product LINE (last column) would then show the total of the complete product (like it does now - that's okay):



* * *

Option B: This option can show the options correctly with its single price and total price. But it is really unpractical if the customer is not able to change anything in his order (same for the mini cart in the header).

Possible solution: Technically the "options product" is an option, right? Would it be possible to add a "technical flag" to these options in the cart? Every entry in the cart - with this flag - would not show any quantity or delete button. I think this could be a useful thing because in most cases we would not allow the user to change only the quantity of options.

But there is another problem. If I choose "10" pieces of a product (with options), the shops puts automatically (correctly) the same quantity of options to the cart. The cart then contains 2 x 10 products. That's correct. But if I change the quantity of the main product - the quantity of the options does NOT change too. How can we solve this?

Cheers
Rusty

P.S. Addition to Option A: As an alternative - would it be possible to summarize ALL options prices to one total options sum to display it as separate line in the footer, like "payment fee". In this case the "total product price" per line must not contain the options price.

Attachments:
Last edit: 1 day 14 hours ago by Rusty.

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

  • Posts: 83674
  • Thank you received: 13545
  • MODERATOR
1 day 10 hours ago #366904

Hi,

Option A:
Changing the look like you say in your screenshot is possible. Again, this requires custom code modifications. And as before, you'll likely want the modification to be consistant in the emails, the invoice, the order, etc. So, again we're looking at a few hours of work if you want me to change these.

Summarizing the options as a total is possible, but this is more involved. It would require the development of a custom plugin. The cost would be twice as important.

Option B: Supporting these would require more extensive modifications. That's not practical. In this mode, the options are supposed to be independent from the main product once added to the cart. Not allowing the user to change the quantity in the cart was a way to circumvent this for you, but if the fact that the user can't change the quantity in the cart is a problem for you, then this is not a practical solution to build upon I think.

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

  • Posts: 61
  • Thank you received: 5
  • Hikashop Business
1 day 8 hours ago #366905

Hi nicolas,

nicolas wrote: Option A:
Changing the look like you say in your screenshot is possible. Again, this requires custom code modifications. And as before, you'll likely want the modification to be consistant in the emails, the invoice, the order, etc. So, again we're looking at a few hours of work if you want me to change these


okay ... I think this would be the best / most useful solution. Do you want me to write my exact needs here or via direct contact or email so you can make me an offer?

Cheers
Rusty

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

  • Posts: 83674
  • Thank you received: 13545
  • MODERATOR
1 day 5 hours ago #366906

Hi,

We can talk about the details by email.

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

  • Posts: 61
  • Thank you received: 5
  • Hikashop Business
18 hours ago #366909

Hi,

nicolas wrote: We can talk about the details by email.


okay, I mailed you.

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

Time to create page: 0.108 seconds
Powered by Kunena Forum