Z
zafarkhon
Прохожие
- Автор темы
- #1
Когда нету товара в складе место кнопки «купить» должен появится кнопка «оповестить». Как это нужно делать помогите, пожалуйста! Срочно нужен.
Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
У меня галочка стоит. мне нужно чтобы когда товара в складе нету должен появится место кнопки купить кнопка оповестит!
товар в складе>0 "Оповестить"
товар в складе>1,2,3,4 "Купить"
/* ADD-TO-CART */
$addtocart = "<div>
<form action=\"". $mm_action_url."index.php\" method=\"post\" name=\"addtocart\" id=\"addtocart\">"
.$ps_product_attribute->list_attribute($product_id)
// added for the advanced attribute modification
.$ps_product_attribute->list_advanced_attribute($product_id)
// end added for advanced attribute modification
.$ps_product_attribute->list_custom_attribute($product_id);
// end added for custom attribute modification
if (USE_AS_CATALOGUE != '1'
&& $product_price != ""
&& !stristr( $product_price, $VM_LANG->_PHPSHOP_PRODUCT_CALL )
&& $auth['show_prices']) {
$quantity = mosGetParam( $_REQUEST, 'quantity', 1 );
$addtocart .= "
<p><label for=\"quantity\" style=\"vertical-align: middle;\">".$VM_LANG->_PHPSHOP_CART_QUANTITY.":</label>
<input type=\"text\" class=\"inputbox\" size=\"4\" id=\"quantity\" name=\"quantity\" value=\"$quantity\" style=\"vertical-align: middle;\" />
<input type=\"submit\" ";
$addtocart .= "style=\"text-align:center;background-position:bottom left;width:160px;height:35px;cursor:pointer;border:none;font-weight:bold;font-family:inherit;background: url('". IMAGEURL ."ps_image/".PSHOP_ADD_TO_CART_STYLE ."') no-repeat left center transparent;vertical-align: middle;\" ";
$addtocart .= "value=\"".$VM_LANG->_PHPSHOP_CART_ADD_TO ."\" title=\"".$VM_LANG->_PHPSHOP_CART_ADD_TO."\" />
</p>
<input type=\"hidden\" name=\"flypage\" value=\"shop.$flypage\" />
<input type=\"hidden\" name=\"page\" value=\"shop.cart\" />
<input type=\"hidden\" name=\"manufacturer_id\" value=\"$manufacturer_id\" />
<input type=\"hidden\" name=\"category_id\" value=\"$category_id\" />
<input type=\"hidden\" name=\"func\" value=\"cartAdd\" />
<input type=\"hidden\" name=\"option\" value=\"$option\" />
<input type=\"hidden\" name=\"Itemid\" value=\"$Itemid\" />";
}
$addtocart .= "</form>
</div>";
/* ADD-TO-CART */
if (USE_AS_CATALOGUE != '1'
&& $product_price != ""
&& !stristr( $product_price, $VM_LANG->_PHPSHOP_PRODUCT_CALL )
&& $auth['show_prices'])
{ if ($db_product->f ('product_in_stock') == 0) {
$addtocart = "<div>
<form action=\"". $mm_action_url."index.php\" method=\"post\" name=\"addtocart\" id=\"addtocart\">"
.$ps_product_attribute->list_attribute($product_id)
// added for the advanced attribute modification
.$ps_product_attribute->list_advanced_attribute($product_id)
// end added for advanced attribute modification
.$ps_product_attribute->list_custom_attribute($product_id);
// end added for custom attribute modification
$addtocart .= "
<p><input type=\"submit\" style=\"text-align:center;background-position:bottom left;width:160px;height:35px;cursor:pointer;border:none;font-weight:bold;font-family:inherit;background: url('". IMAGEURL ."ps_image/".PSHOP_ADD_TO_CART_STYLE ."') no-repeat left center transparent;vertical-align: middle;\" ";
$addtocart .= "value=\"".$VM_LANG->_PHPSHOP_CART_ADD_TO_NT ."\" title=\"".$VM_LANG->_PHPSHOP_CART_ADD_TO_NT."\" />
</p>
<input type=\"hidden\" name=\"flypage\" value=\"shop.$flypage\" />
<input type=\"hidden\" name=\"page\" value=\"shop.cart\" />
<input type=\"hidden\" name=\"manufacturer_id\" value=\"$manufacturer_id\" />
<input type=\"hidden\" name=\"category_id\" value=\"$category_id\" />
<input type=\"hidden\" name=\"func\" value=\"cartAdd\" />
<input type=\"hidden\" name=\"option\" value=\"$option\" />
<input type=\"hidden\" name=\"Itemid\" value=\"$Itemid\" />";
$addtocart .= "</form>
</div>"; }
else {
$quantity = mosGetParam( $_REQUEST, 'quantity', 1 );
$addtocart = "<div>
<form action=\"". $mm_action_url."index.php\" method=\"post\" name=\"addtocart\" id=\"addtocart\">"
.$ps_product_attribute->list_attribute($product_id)
// added for the advanced attribute modification
.$ps_product_attribute->list_advanced_attribute($product_id)
// end added for advanced attribute modification
.$ps_product_attribute->list_custom_attribute($product_id);
// end added for custom attribute modification
$addtocart .= "
<p><label for=\"quantity\" style=\"vertical-align: middle;\">".$VM_LANG->_PHPSHOP_CART_QUANTITY.":</label>
<input type=\"text\" class=\"inputbox\" size=\"4\" id=\"quantity\" name=\"quantity\" value=\"$quantity\" style=\"vertical-align: middle;\" />
<input type=\"submit\" ";
$addtocart .= "style=\"text-align:center;background-position:bottom left;width:160px;height:35px;cursor:pointer;border:none;font-weight:bold;font-family:inherit;background: url('". IMAGEURL ."ps_image/".PSHOP_ADD_TO_CART_STYLE ."') no-repeat left center transparent;vertical-align: middle;\" ";
$addtocart .= "value=\"".$VM_LANG->_PHPSHOP_CART_ADD_TO ."\" title=\"".$VM_LANG->_PHPSHOP_CART_ADD_TO."\" />
</p>
<input type=\"hidden\" name=\"flypage\" value=\"shop.$flypage\" />
<input type=\"hidden\" name=\"page\" value=\"shop.cart\" />
<input type=\"hidden\" name=\"manufacturer_id\" value=\"$manufacturer_id\" />
<input type=\"hidden\" name=\"category_id\" value=\"$category_id\" />
<input type=\"hidden\" name=\"func\" value=\"cartAdd\" />
<input type=\"hidden\" name=\"option\" value=\"$option\" />
<input type=\"hidden\" name=\"Itemid\" value=\"$Itemid\" />";
$addtocart .= "</form>
</div>";
}
;}