(SOLVED) Some problems when add order in backend

  • Posts: 71
  • Thank you received: 0
10 years 8 months ago #147580

-- url of the page with the problem -- : wpb.es
-- HikaShop version -- : 2.2.3 bussiness
-- Joomla version -- : 3.2.1
-- PHP version -- :5.4
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message

Hi
I have 2 problems.
1- When I add a new order in backend, don´t increases 1 unit in table hikashop_product in field product_sales
2- When I add a new order in backend, reduce 2 units in stock, but I add select 1 unit
I need add orders in backend, because some clinets phone me to buy directly, and I need know how many sales I have in all products
I use variants in each product
Regards

Last edit: 10 years 7 months ago by vaughan. Reason: Solved

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

  • Posts: 13201
  • Thank you received: 2322
10 years 8 months ago #147609

Hi,

I tried to reproduce the problem on my end, but the stock is increased correctly, like the product sales.
Could you give us more informations about the installed extensions, modules or plugins you have.

It's probably one of them which is causing the issue.

The following user(s) said Thank You: vaughan

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

  • Posts: 71
  • Thank you received: 0
10 years 8 months ago #148354

I find part of my error, there was an error in my database structure in order_product table, there was not autoincrement in order_id field.
Now deduct 1 unit in each order, but the sales not increment in 1 unit (maybe a similar error) I'm comparing a new installation tables wint my production site, but ican't find my error....

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 8 months ago #148357

Hi,

If you do not have the official tables in your database. It will be difficult to reproduce your problem.
It asked for a deep analyze in order to understand why the stock is not modified and look at the request which generally increase the product sale counter.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: vaughan

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

  • Posts: 71
  • Thank you received: 0
10 years 7 months ago #151042

Hi

Well I solved my probelms with tables, but I still having some problem when I add an order in backend, don´t add 1 unit in product sales but only happen this error if the product has variants (characteristics) I check in the yellow box to add a product and select variants in select list and then I select the variant I want to add into the order, It's correct?. If I make a order in frontend like a customer, works fine and add 1 unit in product_sales, in backend NO.
I see o









I installed a local test site, a new installation, and I have same problem, don´t add 1 unit in product_sales field in the table hikashop_product when I create a new order in a product with variants in backend.

Why it happens?

Thanks for all

Attachments:
Last edit: 10 years 7 months ago by vaughan.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 7 months ago #151773

Hi,

Please edit the file "administrator/components/com_hikashop/classes/order_product.php" and replace the line

$query = 'UPDATE '.hikashop_table('product').' SET product_sales = product_sales + '.$k.' WHERE product_sales >= '.(-$k).' AND '.implode(' AND ',$filters);
By:
$query = 'UPDATE '.hikashop_table('product').' SET product_sales = product_sales + '.$k.' WHERE product_sales >= '.(-$k).' AND ('.implode(' OR ',$filters).')';
It should fix your problem.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: vaughan

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

  • Posts: 71
  • Thank you received: 0
10 years 7 months ago #151838

Great! Great! Great! Great! Great! Great! Great! Great! Great! Great! :woohoo: :woohoo: :woohoo:
Thanks a lot!!!! works fine!!!

Best regards!

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

Time to create page: 0.090 seconds
Powered by Kunena Forum