duanduo7400
duanduo7400
2018-03-08 15:39

在添加到购物车时,通过Woocommerce中的GET请求将自定义数据传递到购物车项目

  • wordpress
  • php

How to pass custom meta data to cart item via parameters in the URL (using a GET request) when adding to cart a product?

Example:

  • custom_price = 99.99
  • custom_reference_meta = REF0019

So the Add to cart URL will be something like:
http://yourdomain.com/?add-to-cart=25&custom_price=99.99&custom_reference_meta=REF0019

I need to do this because I'm doing a adding product via query string.

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答