vocabo Posted April 17, 2011 Share Posted April 17, 2011 Hello,I would like to add a custom page to my template. I need my page to be able to add products to the cart that are not present in the database. These products will be personalized by the user and in general will differ from the products in the database. How can I do this? Thanks in advance! Link to comment Share on other sites More sharing options...
tomerg3 Posted April 17, 2011 Share Posted April 17, 2011 You cannot add to the cart products that are not in the database.You probably should try to find a different approach, either way, it sounds like quite a complex problem, not something that will be solved by a few lines of code. Link to comment Share on other sites More sharing options...
vocabo Posted April 18, 2011 Author Share Posted April 18, 2011 Thank you for your fast reply!Before looking for other solution I will give it another try. I will appreciate any suggestions. I have a module which enables the users to add prints and text to the product and then eventually to purchase it. Let's say that I will use a product from the database. How to access its views images and to replace them with the user generated design of the product? Then possibly I have to add the personalized product to the database in order to add it to the cart after that.www.zazzle.com is a good example of what I am trying to achieve.Basically I need four functions to be used from my php page: $product = get_product($product_id); edit_product($product, $new_data); add_product_to_database($product); add_product_to_cart($product_id) Thanks! Link to comment Share on other sites More sharing options...
tomerg3 Posted April 18, 2011 Share Posted April 18, 2011 It's not as simple as 4 php commands.you should look into the product class (/classes/Product.php), and see how's it's being used/ updated.You can do the first 3 functions you want using it.To add to the cart, you can look into / controllers/CartController.php Link to comment Share on other sites More sharing options...
keweli Posted April 19, 2011 Share Posted April 19, 2011 What do you need the customer to personalise?The features, attributes, and groups for every product already give a lot of options. You can always add to them. Link to comment Share on other sites More sharing options...
vocabo Posted April 20, 2011 Author Share Posted April 20, 2011 The customer will be able to add prints and lines of text and to specify where. After that a new image for the product will be generated with the user design and information about the text, font, color, size and rotation of the user design. I need to add the personalized product to the cart, but it seems this is not an easy task. PrestaShop doesn't support virtual products to be added to the cart and there is not an API documentation, explaining the basic tasks. It is a bit of misleading to classify PrestaShop as an open source system. In my understanding this term means documentation and flexibility for extensions.Best regards! Link to comment Share on other sites More sharing options...
naeems Posted April 4, 2012 Share Posted April 4, 2012 I also wanted to add my php files and want to add custom product to cart. Actually i m working on a canvas printing site. Customer upload image select product size, crop picture and select some effects then add to cart. So i need function/class reference to add product (picture, size, effect, rate, etc) and continue with prestashop checkout/cart system ??? Addition: Also want to know how to link external php files to prestashop? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now