Apply Custom Option via Ajax to a product - magento

Has anyone had any success in Applying a custom option to the product object via Ajax.
ie. A ajax request will get triggered when ever I select a custom option which changes the product price.
I have a ajax Block in the Product View page that depends on the Product Price. Since Magento Applies the Custom Options after the product is added to the cart , I am finding it difficult to render the ajax block with my updated product price.
Any idea's ?

Try this module, its good ajax cart and it has exactly what you need and you can customize it easily
https://github.com/hws47a/VF_AjaxCart

Related

How to get current variation price in woocommerce single product page using ajax?

On Single product page of a variable product of woocommerce when user selects product options; woocommerce makes an ajax call and shows the variation price and inventory available. I just need to know how can I add my custom math to that ajax response? For example current variation price ajax response was 300 I want to add 30 more to that. Can anybody help plz?
I searched woocommerce files but no luck.

Orchard Ajax Request

Currently we have a few products defined in Orchard.
We managed do display these products by using a query in combination with projection.
I executed the same steps as described in this tutorial, Defining and rendering the ProductCatalog Content Type
There is also a menu to navigate inside products catalog. When selecting category, the full page is refreshed. How can we implement a ajax request each time user select a product category in menu?
Here i will show you an example of the screen:
I guess your best bet is to do something along those lines:
Create a module with a custom ApiController
Write an alternate for your category navigation in which you send an ajax request to your controller
Use IContentManager in your controller to query for your products and return them as a json result
Update your page from your result

Update Custom Options via Querystring from external site - Magento

We have an external site that has our product with a few options, and we want to pass that data from that site to the product page of the store so that the customer can update more attributes and add an image. I know there is a way to add it directly to the cart but we want them to stop at the product page first to answer more questions before adding to cart.
Is this possible?
Thanks for any help in advance.
I would use an observer to capture the event before the add to cart, and grab the values needed and set them on the product option of the PDP.
More details on the observer pattern can be found here:
http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/customizing_magento_using_event-observer_method

Magento put single product in catalog mode

i have a Magento shop and want to do the following:
Some of the products should not be available for buying (they should be put in some kind of catalog mode).
How could this be achieved in Magento?
Make some custom attribute for those products. For example:
can_sale
And on frontend display add to card button depending on this attribute. Like this:
if($product->getCanSale() == 1){
/*Display add to cart button*/
}else{
/*Dont' display add to cart button*/
}
The above answer works, but is a template solution for something that (in principle) should be solved server-side.
If any of your visitors is savvy enough to construct an add-to-cart URL, they can still add products you hid the cart button for, to their carts. Probably a very minor problem of course, in this case.
There's an extension called Not2Order, don't know if I'm allowed to link it here. That extension takes care of enabling / disabling the ordering of products from the server side, which is a little more robust.

how to add default variants to product in magento

I'm very new to Magento.I am having product with some variants like "size" with values "large XX,small XX,medium XX".I want the feature to make any one of this values as default in admin.
my screenshot explanation here
How can i do this
please help me!
When you say you want them to be defaults, you are being a little vague. Are you talking about using configurable products for this? Custom product options? When you say "default in admin", what do you mean? Which page are you referring to? More detail will help us answer the question.
Thanks,
Joe
As far as I know, what you are asking for is not a default functionality of Magento, but it shouldn't be difficult to add some javascript to allow you to force selections at page load time. Ultimately, it's just code, so it's definitely possible to do.
my suggestion would be to add a attribute to all you products called for instance "defaultselect" then you can enter your value easily from the backend to your configurable product.
so now you have a configurable product say a hat which comes in 3 sizes, and has 3 assigned simple products. set the defaultselect value to one of the size values
now some layout xml and javascript is required to get you product attribute to work with the magento selects.
first you want to actually include you js. this is done through the layout xml. you can include update using add js method for PRODUCT_TYPE_configurable handle
now the js. store the js in the skin js folder.
to make this work you would need to know the configurable product defaultselect attribute value we're testing against. this could be retrieved with your own ajax function to a method which checks if the current product has a defaultselect attribute and returns it's value or false.
if you have a value from your ajax function you can work with that ie you have both the returned attributes from the configurable product and magento will return the rest.
however after that it seems to get complicated your going to have to do something with the js magento aready uses to render product options

Resources