Page 1 of 1

How can i added related products in OPC in cart?

PostPosted: Sun Apr 21, 2019 2:27 pm
by starac012_1@.....ru
Hello, how can i add to show related products in cart, when i use one page checkout?

Re: How can i added related products in OPC in cart?

PostPosted: Mon May 20, 2019 1:26 pm
by admin
hello, it would need to be done programatically or by using a custom module.

if you already got a module that can detect product IDs in the cart and load their related product's IDs you can install OPC positions + make the module to be displayed under the cart + make sure it does not break OPC form.

generally:
- you need to collect the related product IDs which are mostly stored in product custom fields table (note that this is the slowest table in whole virtuemart and a query to this table can kill performance of whole your site and slow down the checkout, so if there is 20 products in the cart and they also got parent products, it can take many tens of seconds to load all of their related products)
- once you have the IDs you can copy code from "mod_virtuemart_product" module into OPC's basket.html.php OR onepage.unlogged.tpl.php depending where you want to show it
- if using "ajax cart" (when whole OPC is wrapped in a single from) you must make sure that any related product is loaded without form tags

if needed we can arrange some time for custom works in this matter if you know exactly what you want.

best regards, stan