Substitute product in order

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
13 years 3 months ago #22966

Hi,

is there an easy way to substitute a product in an order in the back end? It is easy to delete an a product in the order, but clicking the plus button means I can add an product manually, but not easily access the products already in the shop.

Thanks,

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #22976

Hi,

You can also edit an existing product of an order. But as for when adding a new product to an order you won't be able to select another product from your store. You will have to enter the name/price change yourself.

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

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
13 years 3 months ago #23019

Okay understood. Are there any plans to allow the back admin to insert products directly from products in the database rather than do it manually?

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #23027

Sure. That's something we would like to do in the future.

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

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
13 years 3 months ago #23056

Hi Nicolas, is this something in the pipeline or has it not really been considered? If not I don't mind adding it and sending the files. I was thinking of keeping the add button as it always useful to add products which are not in the store, and adding an insert button to insert a product from the store directly.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #23068

It's not in the pipeline at all for now as we are busy working on a filtering system and other things for next release.

If you can add it on your end and send your modifications, you're more than welcome to do so :)

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

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
13 years 3 months ago #23069

okay will do.

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

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
13 years 3 months ago #23115

Hi Nicolas,

we have the products listing a pop-up window with the category explorer on the left. In your opinion what is the best way to get the selected product row data inserted in the product order list. Can we tap into the save function in the order controller or should we use a method similar to the select/add category for a product?

Thanks

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #23128

Hi,

You should add a new task addproduct in the order controller and add the information to the database directly there using the save function of the class order_product. You need to pass it an array of products object with all the necessary attributes:
product_id, order_id, order_product_quantity, order_product_name, order_product_code, order_product_price, order_product_tax
The atributes order_product_options and cart_product_id should be empty.

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

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
13 years 3 months ago #23145

Do we need to add anything for [history] and [mail]? And can you point me in the right direction to get the price without tax and the tax in the addproduct function. Thanks

Last edit: 13 years 3 months ago by jameswadsworth.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #23165

No, you don't need to add any history or mail.

For the product price, you need to do something like that:

$productClass = hikashop::get('class.product');
$product = $productClass->get($product_id);
$currencyClass = hikashop::get('class.currency');
$config =& hikashop_config();
$main_currency = $currency_id = (int)$config->get('main_currency',1);
$zone_id = explode(',',$config->get('main_tax_zone',0));
if(count($zone_id)){
	$zone_id = array_shift($zone_id);
}else{
	$zone_id=0;
}
$discount_before_tax = (int)$config->get('discount_before_tax',0);
$ids = array($product_id);
$currencyClass->getPrices($product,$ids,$currency_id,$main_currency,$zone_id,$discount_before_tax);

var_dump($product->prices);

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

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
13 years 3 months ago #23166

Okay thanks. The product_add function now calls correctly the class order_product 'save function' and the product is saved. Just two things to complete. The pop-up windows remains open after clicking the product_add button and we have to manually refresh the page to see the inserted products. Any pointers. Thanks

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

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
13 years 3 months ago #23167

Sorry to answer my own question but I have just found the terminate function which should do the trick. Right?? What type should we use?

Last edit: 13 years 3 months ago by jameswadsworth.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #23184

Yes, you should use the terminate function. You should use the type 1.

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

  • Posts: 272
  • Thank you received: 3
  • Hikashop Business
13 years 3 months ago #23318

Are there any plans in the near future to allow administrators in the backend create orders?

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #23341

We want to add that but we don't have the time to do it for now. What needs to be done for that is to add the possibility for the admin to change the user of an order and select addresses directly from the user selected for the order.
Then, you could have a new order button which would just create an empty order and you would be able to fill all the data for the order from the order edition screen as it is now.

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

Time to create page: 0.055 seconds
Powered by Kunena Forum