Jump to content

How to prepare cart with few products for customer?


Tomi14

Recommended Posts

I want to create shoping cart with few products in, and send a link to customer.

There are a lot of individual products in the store, you need 4 or 5 to complete a set, and I would like to make shopping easier for interested customer.

Link to comment
Share on other sites

Are you familiar with writing modules? You can make a copy of the simple Buy button module and make some adjustments to make it work. In RedirectManager.php file, you have $this->addProductToCart($idProduct, $idProductAttribute) function which is responsible for adding products to the cart. You must provide all product parameters in the url, e.g. module/ps_buybuttonlite/RedirectManager?action=1&products=1,1-2,null-3,2 and update the addProductToCart() function to return the correct product id and attribute id parameters from url params. So from the url params products=1,1-2,null-3,2 you should have an array like [0 => [1,1], 1 => [2, null], 2=> [3,2]]. Put new array in foreach loop where you put data inside addProductToCart() function. 

If you are not a developer, you can write a request to rework the module on the forum

Link to comment
Share on other sites

Option mentioned by @Piotr3qx don't only create cart but also add products to customer existing cart so in that case if customer don't remember what products have already in cart will not be aware what exactly products are added by seller. In some cases it could be valuable behaviour but in other cases not.

Link to comment
Share on other sites

I don't know that much about it. Just enough to correct a line of code to get the effect.

I would like to be able to send this to customers without an account on my store. I collect three or four products to buy, give a discount code, send a link and if the customer wants it, he buys it at a discounted price.

Link to comment
Share on other sites

On 1/15/2023 at 3:15 PM, Tomi14 said:

I already found it, following the previous advice, but I haven't figured out yet how to create a link without customer data.

How about creating a user for the customer and then send his link to him/her?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...