сделал скидку в зависимости от суммы в корзине, но остался небольшой штрих..
делал как тут:
Для просмотра ссылки Войди или Зарегистрируйся
The Virtuemart ecommerce system for Joomla does not allow, as standard the application of a discount based on the total value of the shopping cart.
This method will deliver this functionality.
As always make sure you have a back up of any file before you make changes!!!
Virtuemart and Joomla are both open sourced projects. The benefit of this is that fixes like this can be readily developed by the worldwide community of users and developers.
Detailed instructions are found below.
Step 1. Added this to english.php
/**New for global discount*****/
var $_PHPSHOP_GLOBAL_DISCOUNT = 'Global Product Discount';
var $_PHPSHOP_GLOBAL_DISCOUNT_INFO = 'Enter your global product discount in decimals. This discount will be applied to products in your shopping cart at the time of checkout';
var $_PHPSHOP_GLOBAL_DISCOUNTABOVE = 'Global Product Discount Minimum Cart Value';
var $_PHPSHOP_GLOBAL_DISCOUNT_ABOVEINFO = 'Enter your global product discount start level in decimals. The discount will be applied when your shopping cart exceeds this amount at the time of checkout';
/**End of New for global discount*****/
Step 2. ps_config.php added below line $my_config_array = array(
/***New for global discount***/
"GLOBAL_DISCOUNT" => "conf_GLOBAL_DISCOUNT",
"GLOBAL_DISCOUNTABOVE" => "conf_GLOBAL_DISCOUNTABOVE",
/***End New for Global Discount***/
Step 3. In admin.show_cfg.php around line 120 added this (So that I could have a text box in the Price Configuration of the VM Global Configuration.)
/**New for Global discount**/
<tr>
<td class="labelcell"><label for="_VM_GLOBAL_DISCOUNT"><?php echo $VM_LANG->_PHPSHOP_GLOBAL_DISCOUNT ?> </label></td>
<td><input type="text" name="conf_GLOBAL_DISCOUNT" class="inputbox" value="<?php echo GLOBAL_DISCOUNT ?>" /></td>
<td><?php echo mm_ToolTip( $VM_LANG->_PHPSHOP_GLOBAL_DISCOUNT_INFO ) ?></td>
</tr>
<tr>
<td class="labelcell"><label for="_VM_GLOBAL_DISCOUNTABOVE"><?php echo $VM_LANG->_PHPSHOP_GLOBAL_DISCOUNTABOVE ?> </label></td>
<td><input type="text" name="conf_GLOBAL_DISCOUNTABOVE" class="inputbox" value="<?php echo GLOBAL_DISCOUNTABOVE ?>" /></td>
<td><?php echo mm_ToolTip( $VM_LANG->_PHPSHOP_GLOBAL_DISCOUNT_ABOVEINFO ) ?></td>
</tr>
/**End New for Global discount**/
Step 4. In basket.php below $product_rows = Array(); added
// Added for Global Discount
$disc = GLOBAL_DISCOUNT;
$disc_2 = $disc/100;
$disc_1 = 1-$disc_2;
$discabove = GLOBAL_DISCOUNTABOVE;
$discadded=0;
$discstate="";
//End added for global discount
Step 5. basket.php around line 161 just below } // End of for loop through the Cart
I added
/******Add code here to change total by percent if above £value*****/
if ($total>=$discabove) {
$total = $total*$disc_1;
$discadded=1;
$discstate = "YOU HAVE RECIEVED A " . $disc . " % DISCOUNT!!";
}
/****end discounting mod******/
Step 6. basket.php around line 161 just above $tax_total += $shipping_tax;
I added
/******Add code here to change total by percent if above £value*****/
if ($discadded = 1) {
$tax_total = $tax_total*$disc_1;
}
/****end discounting mod******/
to adjust the tax just before adding shipping
Step 7. In basket_b2c.html.php around line 70 added this (this flags a message to a user when they update the basket to take value above the preset level for application of discount.
<!-- added for global discount -->
<h3><strong><?php echo $discstate; ?> </strong></h3>
<!-- end added for global discount -->
все сделал, в basket_b2c.html.php поправил чтобы выводилась надпись о скидке если она есть, НО!
когда нажать "Оформить заказ"
то цена получается в следующем шаге БЕЗ СКИДКИ
как поправить?
Для просмотра ссылки Войди или Зарегистрируйся
вот этот шаг где неправильно - не считается скидка
Для просмотра ссылки Войди или Зарегистрируйся