[英]Magento 1.9 add configurable product to cart via url
I've been figure it out since ytd and still not found the answer yet. 自从ytd以来我一直在弄清楚它仍然没有找到答案。 On my magento 1.9 i made a custom module that require adding product to cart via url. 在我的magento 1.9上,我制作了一个自定义模块,需要通过网址将产品添加到购物车。 no problem with simple product, but in configurable product, product not save to cart. 简单的产品没问题,但在可配置的产品中,产品不保存到购物车。 here are a couple of url i've used : 这里有几个我用过的网址:
207 = configurable product ID
136 = super_attribute ID
14 = super_attribute value
http://storeurl.com/checkout/cart/add/product/207/?super_attribute[136]=14
http://storeurl.com/checkout/cart/add/product/207?super_attribute[136]=14
http://storeurl.com/checkout/cart/add/product/207?super_attribute[136]=14/form_key/cRnetTlCw43Jtr9B/
none of those url working. 这些网址都没有工作。 i feel like i'm stuck here. 我觉得我被困在这里。 Please somebody help me. 请有人帮帮我
Thanks 谢谢
在最新的magento版本中,我们还需要添加表单键。
https://{site-name}/checkout/cart/add/product/{product_id}/form_key/{form_key}?super_attribute[{attribute_id}]={attribute_value}&super_attribute[{attribute_id}]={attribute_value}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.