I am working on an e-commerce project and I would like to set up 2 dropdown lists linked in ajax. The first list contains the products and the second one contains the quantity of each product.
There is a problem when a user selects a product and then a quantity, and, in the same time another user selects a product and then a quantity => the quantities are not correct. I will try to explain what I mean.
Imagine a first product named "A" with 2 quantities.
A first user choses this product and selects 1 quantity.
there is one quantity left for this product.
At this same very moment, if another user selects the same product, the quantities show "2" ! It is difficult to explain but I wonder if a timeout function should fix this.
You could use setTimeout to update the quantity drop down items every so often based on the product the user has currently selected however I think this a bit overkill.
You would also have to set and store on the server the quantity values every time the user changed their selection.
It is do-able but I would just re-validate the quantity the user has selected is still available once they submit the form.
Related
i have a huge product table, this is its simplified structure:
ID|SHOP|...|MPN|PRICE|CLICKS
i can have the same product coming from different shops, every shop have its own product ID, but (if the shop support it) the MPN for same products is the same.
when i query the database for products, order them by clicks, and if there is the same product from multiple source it is showed twice.
Since im ordered by clicks, the two "equal products" can be far from each other, so its quiete intensive to elaborate it at runtime (consider also the result are paginated and the two equals could be in differente pages).
i was thinking about a query that (if there are multiple result of the same mpn) duplicate some columns as needed (but them how my software can know about the dynamically created columns), i was thinking about SELF JOIN but i don't know how many shop can carry the same product (maybe i can assume all the shop i use...)
My main problem is in search (or category) result where i have a list of products with the "BUY AT SHOP FOR PRICE" button that redirect to the shop... my goal is to have more button to BUY if the product (equal by MPN) have duplicate.
I can keep clicks aligned for both product when a user click on the buy button and maybe it would help
Product detail page is not a big deal, since i have a single product i can get all other instances of it by MPN and it is quiete easy
Any suggestion?
to clarify a bit more i just added this:
https://www.db-fiddle.com/f/61MMDBX4aRqtUFcwVk7Ujw/5#&togetherjs=oO3r8FlaAJ
it shows a simplified versione of my database structure (at the moment products with same MPN can have different click number, but i can keep them in sync)
this is a sample of frontend
https://www.puredesign.it/catalog/male-Scarpe/
my goal is to have multiple "ACQUISTA SU" button if the product can be found in more shop (i.e. same MPN on different product)
I want to add a checkbox to products in certain categories in my online shop, but when the checkbox is ticked it will need to add 'x' amount to the total of the product.
To complicate things further, the product is total is calculated by (area x product price) after the user has inputted their required Length and Width, the checkbox will need to use the area value and then multiply the area by 2.5 and then add that sub-total to the grand total of the product. It's an add-on to the product. If you catch my drift?
Here's a link to a sample product page. The products are carpets, so when you to tick the checkbox, the carpets will have a stain protection applied and will be charged for.
Is there any snippet of code that could help me here?
So it was a relatively easy solution. It was just a case of turning the product into a variable product and using attributes to make a "yes or no" drop-down box, with one of the options having an increased price. This makes the price change before the area is calculated, unlike the 'product add-ons' plugin, which adds on after.
I can't believe it took me two weeks to find the answer to this.
I have a little question
I have already added an extra field to my product table and this is working very well.
What I want:
But now I want to add an extra field to the ps_product_attribute table and display it below the price depending on the attribute that is selected by the customer.
A little more info:
When you use the Prestashop combinations you can add a reference to every combination. When the customer changes the combination, the reference name is automatically changed (refreshed?) on the product page. So the displayed reference name is depending on the choice of combination the customer is making. This is working fine.
Now just like this I want to display my extra field from my ps_product_attribute table below the price. The extra field is containing a specific price unit that is depending on the attribute choice.
My problem:
I have already added the extra field to the database table (ps_product_attribute) but I do not know how I can display this on on the product page
and
how the value is refreshed (or changed) when the customer selects another combination.
I hope you understand my question. Any help would be grateful.
I am designing a website for wedding cards with Magento.
Each wedding card which a user buys may come with few additional sub products like a Reply Card, an Additional Insert, etc.
For Example:
There is a wedding card named “A”. Now there is a minimum quantity check that we have put over this product. This product comes with 2 complementary inserts per product.
In addition to these 2 complementary inserts a user can buy additional inserts. The user should select the number of additional inserts from a drop down menu. According to whatever number is selected, additional inserts should be generated.
Now suppose he selected 2, so there would be 2 additional inserts. Each additional insert would have a minimum quantity linked to it. And there would be a fixed cost per additional insert.
I am stuck at this position. How can this be achieved in Magento?
This feature can be handled by the "configurable item type".
Make configurable item, select EAV attribute which connect that type selection.
This is way how you present an empty default product visible (with name image price) and after this you can make variables by another simple product with other prices store ammounts etc...
The same way is bundled item (there is no price, and is counted by sum of prices or selected sub-items by customer), magento shows "price starts by ...."
With a bundled product in magento you can select various types of options - drop down for example adds a Qty box so you may choose the quantity of items from the drop down.
I am using Checkboxes instead as i need many choices and need a Qty box associated - how is this possible? I've spent hours trying to code this.
If you use a radio button you can allow user defined qty