仅在定义的 PIN 码中提供 Magento 产品?

Magento product availability in defined PIN codes only?

我有一个基于 Magento 的网站,产品仅限于 Pin 码集。这些 PIN 因产品而异。我需要的是在定义产品时获得输入 PIN 码集的选项。并且在每个产品页面上必须有一个文本字段来检查产品是否可用于访问者输入的 PIN 码。

嗨,首先是这个

1 create a new product attribute with multi-select type 

2 assign all pin codes in there values under attribute options 

3 assign that attribute to the desired attribute set 

4 than for assigning attributes you need to go to product section and assign a desired zip options for that particular product from the multi-select attribute 

5 on product page you need to problematically get all the selected values of that attribute 

6 create a array of that values 

7 create a simple form and when user post some value in that form ,  match that value in the array you defined above. 

8 if the value finds in array than show the cart button and if not do what you want.

我希望这会给你一个非常公平的想法。如果我可以为您做任何其他事情,请告诉我。