草庐IT

variation

全部标签

javascript - Angular : Variations in a template based on a attribute

假设我在AngularJS网络应用程序中有一个Controller,它有一个数据数组,用于存储非常相似但需要不同模板的对象,具体取决于成员变量“类型”。例如:functionfooCtrl($scope){$scope.bar=[{"name":"example1","type":"egType1","text":"Someexampletext"},{"name":"example2","type":"egType2","text":"Someexampletext"},{"name":"example3","type":"egType3","text":"Someexamplete

xml - 未检测到文档的语法约束(DTD 或 XML 模式)

我有这个dtd:http://fast-code.sourceforge.net/template.dtd但是当我包含在xml中时,我收到警告:未检测到文档的语法约束(DTD或XML模式)。XML是:UsedtoCreateinstanceofclassasasaasasaasasasetterjava1false编辑:我更改了xml,现在出现此错误:Thecontentofelementtype"template"mustmatch"(description,variation?,variation-field?,allow-multiple-variation?,class-pat

javascript - WooCommerce:变体更改后触发事件

我们使用Woocommerce来销售彩盒。通常选择可变产品选项。我们添加了一个带有调色板的模态对话框,客户可以从中选择颜色。这是woocommerce的常见下拉菜单旁边。问题是,当我将正确的SlugValue传递给下拉列表时(从调色板中选择它之后),下拉列表中的值是正确的,但是需要触发以发布价格的事件不起作用.我已经尝试触发下拉菜单的onchange事件,但什么也没发生。谁能告诉我,需要触发哪个事件,如何触发? 最佳答案 以防将来有人偶然发现这个:WooCommerce在整个add-to-cart-variation.js中提供触发

php - 显示基于 WooCommerce 购物车商品库存的预计交货日期范围

我正在尝试根据购物车中产品的库存状态在购物车中输出预计交货日期。我有点成功,但现在我被困住了。这是我到目前为止写的。它进入function.php文件functionlieferzeit(){global$woocommerce;$cart_items=$woocommerce->cart->get_cart();foreach($cart_itemsas$variation){$variation_id=$variation['variation_id'];$variation_obj=newWC_Product_variation($variation_id);$stock=$va

php - 如何更改购物车中的可变产品价格以及删除 Woocommerce 中的特定产品表单购物车

我的网站我在购物车中添加了一个可变产品。当时另一个可变产品也添加到购物车中,该产品是礼品产品。现在我想将礼品可变产品价格更改为0,它仅在条件符合购物车中提供礼品的产品。我还想通过单击提供礼品的产品来删除两种相同的产品形式。我的代码下方不适合我。add_action('woocommerce_before_calculate_totals','change_custom_price');functionchange_custom_price($cart_object){$custom_price=0;//Thiswillbeyourcustomeprice$gift_variation_

php - Woocommerce:获取产品变体标题

我正在编写一个插件,但无法获得正确的变体标题在Woocommerce中,我使用的变体称为“展开层压”。但是当我尝试获取变体的标题时,我得到:“Variation#781ofChart”这是使用的代码:foreach($order->get_items()as$item){$product_variation_id=$item['variation_id'];if($product_variation_id){$product=newWC_Product($product_variation_id);$productname=get_item_variations($product_va

php - 在 WooCommerce 可变产品中的每个属性值旁边显示库存状态

我想在我的商店中实现类似这样的东西:我有这个代码,但它在每个变体旁边显示数量。functionget_stock_variations_from_product(){global$product;$variations=$product->get_available_variations();foreach($variationsas$variation){$variation_id=$variation['variation_id'];$variation_obj=newWC_Product_variation($variation_id);$stock=$variation_obj

php - 在产品销售时将自定义文本标签添加到价格

在WooCommerce产品单页上,如果产品有销售价格,则正常价格被划掉,其后面突出显示销售价格。我的问题:我如何添加标签,如"OldPrice:XXDollar"和"NewPrice:XXDollar"而不是只有划掉的和新的价格(促销价)? 最佳答案 Update2(forsimpleandvariableproducts+solvedthebugonsamevariationsprices)当产品打折时,您可以使用woocommerce_sale_price_html中的自定义函数添加自定义标签。和woocommerce_var

php - Woocommerce 仅显示折扣可变产品的一个价格

这是我的WooCommerce网站:sweetworldcandy.com问题是,可变产品价格最低和最高valueisshowingwhatIwantisiftheproductisnotonsaleshowtheleastvalueifitisonsaleshowtheleastvalueandtheleastvalueofofferprice通过添加斜杠作为删除标签我在下面分享了这三张图片以供引用: 最佳答案 2020年更新(适用于Woocommerce3+)自Woocommerce3+以来,已将弃用函数woocommerce_

php - 向 Woocommerce 产品变体下拉列表添加变体库存数量和状态

基于“https://stackoverflow.com/questions/45037405/show-stock-status-next-to-each-attribute-value-in-woocommerce-variable-products/45041602#45041602”,我有以下代码在产品变体下拉列表中显示库存数量+库存状态,并显示产品可用性文本:add_filter('woocommerce_variation_option_name','customizing_variations_terms_name',10,1);functioncustomizing_v