MVC3 shopping cart with dynamic value - asp.net-mvc-3

I am following this tutorial; http://www.asp.net/mvc/tutorials/mvc-music-store/mvc-music-store-part-8
In my project, I want to pass the rental price which is radio button value instead of 'Price'.
How do I pass the radiobutton value for cart with using ajax?
Here is my source details..could you tell me how to pass the radiobutton value with ajax?
I am stock from last 2 weeks really.. I need to your help.
Thanks.
MVC3 passing the radioButton value for shopping cart

I'm not sure you are going to be able to create a decent MVC app by hacking the MVC Music Store without understanding it.
If you go back and actually do / redo the tutorial then I'm sure you will be able to answer your own question.
The link you provided shows
1) How to form post to AddToCart
2) How to post via Ajax in RemoveFromCart
So all you need to do is change AddToCart Controller and View to use the Ajax Post (like RemoveFromCart) and include the selected radio buttons Price value in the post to the controller.
It's all there in the tutorial.
Good Luck!

Related

Let Customers to Input a fixed product quantity in quantity box using a button or radio button in the product page in Prestashop 1.7.x

Greetings of the Day!
I need to have the condition on the product page where we can let our customers input a fixed product quantity in quantity box using a button or radio button in the product page along with the default functionalities with the add to cart mechanism.
Why I need this is because I am using the product volume discount list on the product page and I want the customer to select the quantity directly from the mentioned list.
Pls, find the screenshot attached for reference.
Screenshot for reference
Customers can select the quantity directly from the red rectangle shown in the image through a button/radio/link click.
Hope somebody will help me out with this for which I would be greatly obliged.
Thanks.
to achieve that you should change the responsible tpl file, unless there is an override you should find it in /themes/YOUR THEME NAME/templates/catalog/_partials/product-add-to-cart.tpl
There look for the block {block name='product_quantity'}, right after you will see the input used for it, just build your html structure being aware that you should keep the same name and probably also the same standard classes (but you can add yours as well).
After that style your new radio input in /themes/YOUR THEME NAME/assets/css/custom.css and the trick is done.
I hope you are familiar with tpl/smarty if you have to inject some vars from php, in case you don't need that it is just pure html and css.
Hope my answer helped.
Simone

Getting an image laravel

I hope someone has used Crinsane/LaravelShoppingcart.
I'm using it to create a shopping cart and I've read the documentation but haven't seen anything regarding putting the product image in the checkout page.
I've only managed to get title, qty and price. All I need is the image
You can pass the object of the item when adding it to the cart and then you'll be able to retrieve any extra information you might need from each item.

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

Apply Custom Option via Ajax to a product

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

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