custom field not appearing in cart object

  • Posts: 73
  • Thank you received: 1
11 years 5 months ago #114847

For some reason request_id is not set in this object below. It IS however set in the cart_product table when I create the cart using addToCartFromFields(). I checked it right before check out... then the entire entry just disappears from the table when I pay

    [products] => Array
        (
            [0] => stdClass Object
                (
                    [order_product_id] => 174
                    [order_id] => 106
                    [product_id] => 61
                    [order_product_quantity] => 1
                    [order_product_name] => xxxxx
                    [order_product_code] => xxxxx
                    [order_product_price] => 200.00000
                    [order_product_tax] => 0.00000
                    [order_product_options] => 
                    [order_product_option_parent_id] => 0
                    [order_product_tax_info] => 
                    [order_product_wishlist_id] => 0
                    [request_id] => 
                    [order_product_total_price_no_vat] => 200
                    [order_product_total_price] => 200
                )

        )

Perhaps it has something to do with the fact that the product is manually added to the cart and that the custom field is not actually used through the website. Any way to force the value of that custom field to stay there?

EDIT:
I ran some checks and so far the value is still set in the after_status() method

Last edit: 11 years 5 months ago by Ortix.

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
11 years 5 months ago #114926

Hi,

The custom field value is copied from the cart to the order object in the after_confirm function of the components/com_hikashop/controllers/checkout.php file.
If you don't get it, it's potentially because you turned off the "frontend" option of the custom field and in that case, the system makes sure that the user cannot add a value himself in anyway.
The simplest will be to implement the onBeforeOrderCreate trigger in a hikashop plugin and get the value from the $order->cart object and copy it yourself to the $order object.

The following user(s) said Thank You: Ortix

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

Time to create page: 0.055 seconds
Powered by Kunena Forum