magento configurable product behaviour - php

I am having the following issue with my magento, custom unfortunately, development. The scenario is that the client wants the price of a configurable product to be calculated using a specific formula that involves multiplications, while magento has only sums.
for example one of the attributes is "material" and the other one is number of occurrences so these two have to be multiplied.
I have programmed and created through scripting new products for every possible combination and assigned them to a configurable. But when I go to "add to cart" at the end the price that I have is not the one of the final product, but the one magento calculates.
Has any one been across a similar scenario? Any possible solutions?
Because I might have been to abstract, I will also write my usage example:
The store is about selling jewellery.
Attribute: stone material
Attribute: number of stones
Price: Base Value + (number of stones)x(price of stone material)

I have a strong suspicion that you are changing the price as the item goes into the cart. Is that right? Magento, for some reason which is probably justifiable but not less irritating, will recalculate the price of the item on every page load.
This means that, effectively, you must change the implementation so that the product's internal price calculation is modified to your needs, or the price will never stick.
Hope that helps.
Thanks!
Joe

Related

Magento tier price round off

I'm using Magento 1.4.1.1
I set up a tier price in admin panel and its working well.
The problem is in the shopping cart, it displays only 2 decimal places.
Example:
In my backend I set up a tier price 0.211 but when I check it in the shopping cart, it displays 0.21. By that, it creates a computation problem.
Like when the price is 0.210 and I ordered 250pcs the answer is 52.50,
Unlike when the price is 0.211 and I ordered 250pcs the answer is 52.75.
So there is a computation difference.
I want that the price in the shopping cart to be the same on the tier price that I set up.
Is there a way to do that?
Thanks and Have a Good Day! :)
to answer your question: yes you can, but you have to change the code on many different files in magento, here you'll find more answers: http://www.magentocommerce.com/boards/viewthread/16337/ Don't forget to keep your magento system update proof!

Does Magento allow order and shipping restrictions by country for specific items on the product level?

the product’s page would have a “restricted countries” tab, where we can select countries that the product cannot ship to.
Nope I am afraid recently coded the functionality for a project: Few pointers how I tackled the issue:
You will have to modify the addToCart
functionality to introduce your
logic. Rewrite
Mage_Checkout_CartController::addAction()
You will also need to alter the OnePageController Mage_Checkout_OnepageController::saveBillingAction and saveShippingAction to confirm that the address choosen are not restriced
You will also need to alter Mage_Checkout_MultishippingController::addressesPostAction to do the same address checking during multi shipping checkout.
Admin Changes
You will need a product attribute called restricted_countries ...you will need to set some source and backend models to poplulate the countries in the multi select list in the product tab
I hope this puts you on the right path ... good luck.
Personally I think you should go multi-website and have the product selection, prices and delivery prices setup per currency (or region).
You then should put some GeoIP code on the index.php so that you have one URL for all of your websites.
In that way the person from region A sees the subset of products for their region based on their currency, e.g. ₡7.99 instead of an auto-converted ₡7.57, region B sees a different subset of products e.g. ₱14.99 instead of auto-converted ₱14.23 and so on.
Price points do matter if your site is to be popular, making money and a long term investment then you need price points not auto-converted prices or foreign currency only.
The multi-store, multi-website arrangement is out-of-the-box, easy to setup and with minimal burden on catalog inventory management. Work within the software and the methods available, don't reinvent the wheel.

module for Ubercart to run a discount per product in Drupal?

Hey guys I'm looking for a module and combination of modules to let me add items to Ubercart with discounts. How did you apply them?
These items need to have their own discounts that are not applied to the entire cart, just that product. They should also not require user input to get.
The discount will be based on the quantity of the product added. That is for example:
at 1-10 items, a 5% discount
at 11-25 items, a 25% discount
and so one
So, I can have two or more products all having different discounts based on the number of each. For example:
3 apples 15% discount
1000 nuts 50% discount
I have tried a few options and had no luck, including http://drupal.org/project/uc_discounts_alt, however it is not working with Drupal 6.2.
Also, I'm ok with having to write php to get this to work so if there is something that will let me do that then awesome.
P.S. I'm new to Ubercart but I do not think this is a built in feature
Have you tried uc_coupon module ? I think it's going to help you a lot. ;)
I had this same issue once.
The first time I did it, I utilized uc_get_cart_contents, hard coded my discount conditions, and adjusted the price accordingly. Works, but, doesn't scale.
The second time, I used uc_coupon module. Saved time.

shopping cart price change

Say i have a Laptop for 600.00. Say i change it to $650.00. How do shopping carts handle that? Like do they store the price in the cart or the item? How do they make sure they get the price they wanted but not bill the customer the new change without asking them? Or do most store them in both?
I was thinking maybe i could store it in both.
So if the current price is over the cart price for a item, don't remove it/bill them from their cart. Then after, tell them what was billed/email a receipt for the items that didn't change that was billed(say they had more then one item) and remove it from the cart. For the items that did change, say something like "Items left in cart due to price change, please check if you still want to buy the items at the new price." So leave the items that changed in the cart but update the price in the cart.
Thats my idea on how to do it. I don't think the language should matter. Guess this is more of a logical type question. Do most shopping carts do it this way or is there a better way?
Simple shopping carts are just arrays of products that are maintained through sessions and cookies. You can do anything you want. Just make sure users can't do anything they want such as change prices through the url. But most of all make it very, very, very easy for the user to checkout.
Most developers will create an array with product objects so if any changes are made to a product shopping carts will reflect this change. However, if you change your prices then obvious you will have a problem if a user clicks on on price but then you change it and the uses doesn't see this change until after they paid or become confused why the price went up mid shopping experience.
In terms of maintaining the line item if you have users sign in before they can add things to a cart then you don't need to worry about creating a cookie/session to store the array of the line items until they do checkout and the line items are saved with their information for later reference.
In this case what you will want to do is create a line item which is associated to the object so you can get all the products information but at the same time store the price in that actual LineItem model so if you do update your price it will not affect shoppers mid buying experience.
And if you want users to pay higher prices because you change your mind and want to use the line item model you can just do what is sated in the last paragraph and check the price right before a user decides to checkout. If it is different then let them no that this product is now x amount to purchase and don't forget to apologize.
The short answer, it all depends on how it was coded.
I assume the transaction that you are talking about is in process. If the price changes after the user completes the transaction, then it would be considered a "Bad Thing" in the terms of customer service, and may potentially be illegal in the eyes of your payments processor.
I like your idea of comparing the price in the cart vs the newest price. However if the user can change the value of the price of an item in the request to view the cart, it could cause many problems with what they actually get charged. For example, if the user changed the price of the laptop to $1200, and in your code you reduced the value in their cart by the difference, they could get that laptop for $0, which would be a "Bad Thing".
$1200 - User Input
$600 - Actual Price
-$600 - Adjustment against price
$0 - price customer is charged?
Another example would be if you make the price of the item a value that the user can edit, and they are a malicious user, they could potentially change the price to -$600.00, which again would be a "Bad Thing".
The more secure way to do it would be to store the item ID of the item in the cart in the link to view the cart, then retrieve/update the price of the item in the cart every time the properties (total, etc) of the cart are requested. That way if a malicious user tried the plus or minus trick, they would just get a message that the price has been updated to the "current price".
The OWASP site has some open source security tools that can help test your code against situations where the user tries to high jack a shopping cart. Their address is http://www.owasp.org
If the cart simply contains a reference to the item (such as the id/primary key), you don't need to store the price in two places at all. You simply load the objects from the cart when you need them, and prices will automatically reflect the change. In most cases, the changes will be infrequent enough that it is not a big deal from a user perspective.

Magento, add Clothing size attribute without Configurable Product

I want a simple way to let my user pick there clothing size before buy
but Configurable Product seems like to much overkill. you have to make a product of every size
and then you have to make a configurable product.
the shop is for my dad and if i have to explain him how he has to do this it would be weeks for him to know this, (it took several days to make him learn to create a simple product)
Is there any other possibility to create a product and in the front end let the user select the size attribute ..
there has to be a more simple way than this ?
The reason a configurable product relies on child simple products is to keep track of inventory--the simple product is the physical, shippable unit (Crew Neck Shirt-Red-Small) and the configurable product, as you know, is a "meta" product that groups all of the (Crew Neck Shirt-Some Color-Some Size) combinations together.
If you don't care about having your Magento store track inventory, then you can use a simple product with custom options. This is usually used for things that you make on the fly, like monogramming a t-shirt, or screen printing a t-shirt. Create the simple product and take a look at the Custom Options tab on the left side. There you can define a drop-down for your size and specify the options there. Unlike a product attribute, however, I'm pretty certain that you'll have to re-create the size options for each product that you decide to sell this way.
The Magento Web site has a video tutorial that shows how this works. You might show that to him.
I don't think you'll find too many arguments that the Magento admin interface is extremely confusing--even for computer savvy users--but it is what it is. Good luck!

Categories