I have tried a lot of different suggestions to get this to work, none of which have - these include the addToCart URL method and the $cart->addProduct method.
I can not seem to find any other way of doing this, and have also not found anyone on 1.8 to have this working.
What I am doing is adding a sample system to the site, this means that a product is added to the system programatically (Which works great) and then add this product to the cart (uh oh).
Related
I'm currently attempting to extend the inherent Magento product view to divide the custom options belonging to a configurable product into sections loaded by ajax. The end goal is to create a step by step process guiding the user through each step of the product configuration process before they would add the product to the cart.
Advanced Custom Product Options
We are also utilizing Mageworx's Advanced Custom Product Options to allow for the larger customization of products.
Simple Products Linked to Configurable
Our current environment is set up to handle simple products as configurators for their parent configurable product. When a user navigates to the simple product, they are directed to the configurable product with the option represented by the simple product pre-selected.
End Goal
The hopeful endpoint would be that once a user clicks on a simple product, they would be redirected to the configurable product with a single pre-selected option depending on the simple product. The user would then be able to customize their order, or jump directly to adding it to the cart as is. The customization process would re-evaluate at each step to determine if there is a concurrent step, for example, if the user were to select to add trim, there would be an additional step to customize that trim, whereas if they opted out, the step would be skipped.
The idea is simply a product configurator within the Magento framework, something similar, in function, as to what appears below. The checkout steps being Style, Color, and Size, each which have their own page.
The Overarching Question
I am fairly new to the development of Magento, and am wondering what the best method of attacking this problem is. I have thought of using an observer to hook into before add to cart, but I am unsure it would allow me to refresh the blocks and load in new data. My other idea was to tap into view.phtml and set up some ajax loading within the page itself, but that seemed a bit 'hacky'.
I have spent quite a while searching for examples on how some have overcome this problems, but haven't found much outside of some very vague ideas on what could work. If any one has insight onto a solution to my problem, their thoughts would be much appreciated.
Current Approach
So far I've tried creating a Router for a Controller to handle POST requests to change out the Product Option sidebar when a value is changed. It seems a little bit slow, however.
I am creating a simple test product in magento and trying to add some custom attributes for variants. Unfortunatly these are not showing up in the front end.
So I'm pretty sure it's a theme issue here...
When I add a custom product option such as a drop down, the Add to Cart button vanished and can no longer be purchased... as well as now showing the dropdown.
Any thoughts would be greatly appreciated. Is there a directory to look this stuff up in?
I've added some photos in case my description wasn't clear enough
Thanks
Try clearing your caches
Check the inventory tab, if product is saleable on frontend (in stock and has qty)
check /var/log/ and /var/report for errors
calling isSaleable() on the product object can direct you as well (this check is also in product actions template where the add to cart button is rendered)
Just a note but if you have product variants (say size) you probably want to use configurable products instead of custom options
I have had same issue in my new magento 1.9
I just clean all caches from var/cache
Also clean your cache from magento admin.
How can we customize cart items in magento. I have used custom options but it is not working as intended. All I need is to show some configurable data in cart page and in order page.
Can some one help how can I achieve it.
Edit: To elaborate, along with cart item, type and qty. I want to display supporting text for each item type. I got it working with custom options, but I had to include qty inside custom options which created an issue on cart page during cart update. Now I am looking for some other way by which I can acheive same thing.
Thanks
According to your question, you are trying to edit the product that are in the cart. Hope i am getting you right. For this you just need to have a look at the file default.phtml in
app/design/frontend/base/default/template/checkout/cart/item/default.phtml
This phtml file is responsible for displaying the item in the cart. Here you can get the custom options of the product as well. You can edit as per your requirement.
But remember before you edit copy this file to your theme because this is the best practice not to edit the magento's core files.
Hope this will help.
I followed this answer which works fine: Magento - Programatically added bundle product isn't showing up in frontend
I'm able to generate a bundle product on the fly. Everything works fine.
Only one problem: My bundle product is correctly saved and I can see it through the admin area. But, after this generation on the fly, I have to add directly this product into the basket. The system returns "product not found". Basically, I have to go into the admin area, just save it and then I'm able to add it to the basket.
I really suspect a problem with the indexer but I can't really figure out what's going on.
I tried many solutions like:
Mage::getSingleton('index/indexer')->processEntityAction(
$product,
Mage_Catalog_Model_Product::ENTITY,
Mage_Index_Model_Event::TYPE_SAVE
);
But it still doesn't work.
Any Idea about which code I should trigger after the save method to index only this new added bundle product.
Thank you in advance.
Sounds like you are not creating a stock-item with your product. Therefore there is no stock and you can't add it to your basket?
Have a look into
/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php:672
/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php:571
where a product is generated and the stock data are cleand up / set with default data
In magento when i tried to add related items to cart it doesn't work. I have gone through some references and i found that it has problem only if it has custom options. Products without custom options work prefectly.
I hope it is common for all magento community editions. My Magento version is 1.5.0.1
I tried goole for this solution but no luck. I have also gone through the extensions but i couldn't find one. Please advise. Thanks
Related products wont added in cart,because the customer has to choose proper option.For example,if size is custom option,value must be selected while adding to cart.That make sense right?