Magento - Sell Products by gram - magento

Hi i want to sell products by gram.
For example i'll define 1g=0.015€.
On the product page the customers should input for example 250g.
Which product-type/configuration matches this requirement at best?

You can just use simple product with as custom option for weight of type text field.
Add some javascript to change the price on product detail page.
For adding to cart, you need an observer.
You have to build an observer that catches the add-to-cart event sales_quote_add_item and then you can do the php-stuff in the observer to get the weight and calculate the price.
You can then change the price of the product with:
$observer->getEvent()->getQuoteItem()->setOriginalCustomPrice([your price])

Related

Magento - edit custom priced configurable product in cart

i got a problem with a magento extension(currently for 1.8.1):
I have products in my cart.
Therefore I can choose a gift and add it for free into the cart (via observer the priced is set to 0)
BUT here the problem: if the gift is a configurable product i want to set the options. After editing the product the price is set to the original-price again.
How can i keep the gift-price?
greetz,
Florian
Several ways to accomplish this, but the probably easiest (and cleanest) is via a custom total model.
Here is a description, somewhat dated but should be enough to get you started.
Just make sure your total model is calculated after the subtotal model so your quote item price adjustment sticks.
You will also want to pay attention to whether or not you want your total model to be calculated before or after the tax total model.
How do I get quote totals before saving payment method?

Same product in basket twice with different prices - magento

Is it possible to add the same product to the basket twice or more times with different prices?
I know how to change the price of product when I add it to the basket using an observer and the event checkout_cart_product_add_after. But right now, when I change the price via the quote item in the observer, all products of this type that are already in the basket get the price of the last item of this type that I added…
When you add the product with the changed price add also this to the item and the product:
$data['c_price'] = 'YOUR CUSTOM PRICE HERE';
$product->addCustomOption('c_price', serialize($data));
$item->addOption($product->getCustomOption('c_price'));
This way the new product shouldn't be merged with the previous one, but if you add the product again with the custom price then it will be merged with the one you previously added with a custom price.

Custom option adding product price

Currntly, product price adding to custom product, but I need to change some functionality
I dont want to add product price in to custom option. I want to show same price which I have
added fixed price. How can I do that?

Update magento price using custom attributes

I am a newbie to Magento Framework.
Can any one tell me how to add custom pricing to products based on custom attributes.
For example: I would not enter price or I will enter a dummy number for price in admin panel and other attributes like weight and type of item and category.
Based on the category, weight and type of item I want to calculate the actual price something
like price=weight*category+typeOfItem And also if there is any special price to the product it should also apply along with tier prices
I have created a custom module using Alan Storm's Blog but I am unable to override the pricing. Sometimes it works in the product listing page but never works with 'tier' price.
You might find it easier to use a configurable product for this, assuming you don't have a huge range of weights and products
Otherwise maybe look at overwriting the
getFinalPrice() method in the Mage_Catalog_Model_Product_Type_Price model.

Want to add discounted price field to Cross sell tab in magento

I want to implement following requirement in magento admin panel-
When I add 'A' product to shopping cart then system suggest me 'B','C'.. products with discount price which I already configured through admin panel.i.e want to make a provision to select products and add discounted price..like cross sell tab.
Thanks in Advance...
i think i want the same... use the magento crosssell function to display a particular product(s) at the checkout of another unique product in the normal way. the extra feature required is to hard code a promotional price or % discount into the crosssell item. if a sku 123456 is in the product view or category it has a retail price but if show in crosssell it is shown with a promotional discounted price that is controlled at product level. so maybe this feature is part of the product setup. maybe a new field called crosssell price ?
i have asked aheadworks for clarification on the function of their 'checkout promo' extension.
the ahead works extension seems to be a banner but i'll see what they say.
Is this to use the magento crosssell function to display a particular product(s) at the checkout of another unique product in the normal way? The extra feature required is to hard code a promotional price or % discount into the crosssell item. If a sku 123456 is in the product view or category it has a retail price but if show in crosssell it is shown with a promotional discounted price that is controlled at product level. So maybe this feature is part of the product setup, maybe it's a new field called crosssell price ?
I have asked aheadworks for clarification on the function of their 'checkout promo' extension.
The ahead works, extension seems to be a banner but I'll see what they say.

Resources