Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 5 Ответов
  • 830 Просмотров
*

Dolphin4ik_1

  • Захожу иногда
  • 433
  • 3 / 2
Подскажитe, использую плагин для добавления в корзину One stepcheckout. Хотелось добавить кнопки + - для колиечства товара но ничего не выходит, стандартные способы не работают(

вод код отвечающий за вывод товара в  корзине

Код
<?php
/** ------------------------------------------------------------------------
One Page Checkout
author CMSMart Team
copyright: Copyright (c) 2012 http://cmsmart.net. All Rights Reserved.
@license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
Websites: http://cmsmart.net
Email: team@cmsmart.net
Technical Support: Forum - http://cmsmart.net/forum
-------------------------------------------------------------------------*/
defined('_JEXEC') or die('Restricted access');
$orderInfo = file_get_contents(JPATH_ADMINISTRATOR.'/components/com_vmmanager/helpers/config/orderInfo.json');
$orderInfo = json_decode($orderInfo);
$fontFamily = array(0=>'',1=>"'Lato',sans-serif",2=>"'Open Sans', sans-serif",3=>"'Oswald', sans-serif",
                    4=>"'PT Sans', sans-serif",5=>"'Raleway', sans-serif",6=>"'Roboto', sans-serif");
$orderInfo->color->titleTxtFont = $fontFamily[$orderInfo->color->titleTxtFont];
$orderInfo->color->contentTxtFont = $fontFamily[$orderInfo->color->contentTxtFont];
?>
<style>
    .opc-module-content h2.opc-title.priceTitle{
        background-color:<?php echo  '#'.$orderInfo->color->titleBg ?>;
        color: <?php echo  '#'.$orderInfo->color->titleTxtCl ?>;
        font-size: <?php echo $orderInfo->color->titleTxtSize.'px' ?>;
        font-family: <?php echo $orderInfo->color->titleTxtFont ?>;
    }
    .opc-module-content form.opc-form#priceForm{
        background-color:<?php echo  '#'.$orderInfo->color->contentBg ?>;
    }
    .opc-module-content form.opc-form#priceForm .opc-table,.opc-module-content form.opc-form#priceForm .opc-table li{
        color: <?php echo  '#'.$orderInfo->color->contentTxtCl ?>;
        font-size: <?php echo $orderInfo->color->contentTxtSize.'px' ?>;
        font-family: <?php echo $orderInfo->color->contentTxtFont ?>;
    }
    .order-result li.total{color:<?php echo  '#'.$orderInfo->color->titleBg ?>}
   
</style>
<h2 class="opc-title priceTitle">
    <i class="<?php echo $orderInfo->color->titleIcon ?>"></i>
    <span><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_ORDER_INFO'); ?></span>
</h2>

<form method="Post" action="" name="priceForm" id="priceForm" class="opc-form">
    <div class="opc-table" >
        <div class="order-title">
            <ul>
                <li class="opc-order-total"><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_TOTAL') ?></li>
                <li class="opc-order-discount"><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_DISCOUNT') ?></li>
                <li class="opc-order-tax"><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_TAX') ?></li>
                <li class="opc-order-qty"><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_QUANTITY') ?></li>
                <li class="opc-order-price"><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_PRICE') ?></li>
                <li class="opc-order-name"><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_NAME') ?></li>                       
            </ul>
        </div>
        <?php foreach ($this->cart->products as $pkey => $pvalue):  ?>
        <div class="order-product">           
            <ul>
                <li class="opc-order-total">
                    <?php
                if (VmConfig::get ('checkout_show_origprice', 1) && !empty($pvalue->prices['basePriceWithTax']) && $pvalue->prices['basePriceWithTax'] != $pvalue->prices['salesPrice']) {
                echo '<span class="line-through opc-basePriceWithTax">' . $this->currencyDisplay->createPriceDiv ('basePriceWithTax', '', $pvalue->prices['basePriceWithTax'], TRUE, FALSE, $pvalue->quantity) . '</span>';
                }
                elseif (VmConfig::get ('checkout_show_origprice', 1) && empty($pvalue->prices['basePriceWithTax']) && $pvalue->prices['basePriceVariant'] != $pvalue->prices['salesPrice']) {
                echo '<span class="line-through opc-basePriceVariant">' . $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $pvalue->prices['basePriceVariant'], TRUE, FALSE, $pvalue->quantity) . '</span>';
                }
                echo '<span class="opc-salesPrice">'.$this->currencyDisplay->createPriceDiv ('salesPrice', '', $pvalue->prices['salesPrice'], True, FALSE, $pvalue->quantity).'</span>';
                    ?>
                </li>
                <li class="opc-order-discount">
                    <?php echo "<span class='opc-discountAmount'>" . $this->currencyDisplay->createPriceDiv ('discountAmount', '', $pvalue->prices['discountAmount'], True, FALSE, $pvalue->quantity) . "</span>" ?>
                </li>
                <li class="opc-order-tax">
                    <?php echo "<span class='opc-taxAmount'>" . $this->currencyDisplay->createPriceDiv ('taxAmount', '', $pvalue->prices['taxAmount'], True, FALSE, $pvalue->quantity) . "</span>" ?>
                </li>
                <li class="opc-order-qty">
                    <?php /** Show quantity */ ?>
                    <input type="text" value="<?php echo $pvalue->quantity ?>" name="quantity[<?php echo $pkey; ?>]" id="quantity_<?php echo $pkey; ?>" class="quantity_product" />

<span class="delete-product-cart" data-pid="<?php echo $pkey; ?>"><i class="opc-iconcancel-circled-outline"></i></span>
                    <span class="update-quantity"><i class="opc-iconcw"></i></span>

<input type="text" onblur="Virtuemart.checkQuantity(this,1,'Вы можете приобрести этот товар только в партии, состоящей из %s единиц(ы) товара!');" onclick="Virtuemart.checkQuantity(this,1,'Вы можете приобрести этот товар только в партии, состоящей из %s единиц(ы) товара!');" onchange="Virtuemart.checkQuantity(this,1,'Вы можете приобрести этот товар только в партии, состоящей из %s единиц(ы) товара!');" onsubmit="Virtuemart.checkQuantity(this,1,'Вы можете приобрести этот товар только в партии, состоящей из %s единиц(ы) товара!');" title="Обновить количество в корзине" class="quantity-input js-recalculate" size="3" maxlength="4" name="quantity[<?php echo $pkey; ?>]" value="<?php echo $pvalue->quantity ?>"/>
<span class="quantity-controls js-recalculate">
<input type="button" class="quantity-controls quantity-plus" value="+"/>
<input type="button" class="quantity-controls quantity-minus" value="-"/>
</span>


                </li>
                <li class="opc-order-price">
                    <?php
                        /** Show price*/
                if (VmConfig::get ('checkout_show_origprice', 1) && $pvalue->prices['discountedPriceWithoutTax'] != $pvalue->prices['priceWithoutTax']) {
                echo '<span class="line-through">' . $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $pvalue->prices, TRUE, FALSE) . '</span><br />';
                }
                if ($pvalue->prices['discountedPriceWithoutTax']) {
                echo $this->currencyDisplay->createPriceDiv ('discountedPriceWithoutTax', '', $pvalue->prices, true, FALSE);
                } else {
                echo $this->currencyDisplay->createPriceDiv ('basePriceVariant', '', $pvalue->prices, True, FALSE);
                }
                    ?>
                </li>               
                <li class="opc-order-name">
                    <?php if ($pvalue->virtuemart_media_id) { ?>
                <span class="cart-images">
      <?php
                    if (!empty($pvalue->images[0])) {
                    echo $pvalue->images[0]->displayMediaThumb ('', FALSE);
                    }
                ?>
                </span>
                <?php } ?>
                    <div class="name-val">
                        <?php
                            echo JHtml::link ($pvalue->url, $pvalue->product_name);
                            echo $this->customfieldsModel->CustomsFieldCartDisplay($pvalue);
   echo $pvalue->mf_name;
                        ?>
                    </div>


                </li>
            </ul>         
        </div>

        <?php endforeach; ?>
        <div class="order-result">
            <ul>
                <li class="result-total"><?php echo "<span  class='opc-salesPrice-total'>" . $this->currencyDisplay->createPriceDiv ('salesPrice', '', $this->cart->cartPrices['salesPrice'],True, FALSE) . "</span>"?></li>
                <li class="result-discount"><?php echo "<span  class='opc-discountAmount-total'>" . $this->currencyDisplay->createPriceDiv ('discountAmount', '', $this->cart->cartPrices['discountAmount'],True, FALSE) . "</span>" ?></li>
                <li class="result-tax"><?php echo "<span  class='opc-taxAmount-total'>" . $this->currencyDisplay->createPriceDiv ('taxAmount', '', $this->cart->cartPrices['taxAmount'], True,False) . "</span>" ?></li>
                <li class="result-title"><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_PRODUCT_PRICES_RESULT') ?></li>
            </ul>
        </div>
        <div class="order-result">
            <ul>
                <li class="result-total"><span class="opc-salesPriceShipment"><?php echo $this->currencyDisplay->createPriceDiv ('salesPriceShipment', '', $this->cart->cartPrices['salesPriceShipment'],true, FALSE); ?> </span></li>
                <li class="result-discount"></li>
                <li class="result-tax"><?php echo "<span  class='opc-shipmentTax'>" . $this->currencyDisplay->createPriceDiv ('shipmentTax', '', $this->cart->cartPrices['shipmentTax'],True, FALSE) . "</span>"; ?></li>
                <li class="result-title"><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_SHIPPING_COST') ?></li>
            </ul>
        </div>
       

        <div class="order-result">
            <ul>
                <li class="result-total"><span class="opc-salesPricePayment"><?php echo $this->currencyDisplay->createPriceDiv ('salesPricePayment', '', $this->cart->cartPrices['salesPricePayment'],true, FALSE); ?></span>
                </li>
                <li class="result-discount"></li>
                <li class="result-tax"><?php echo "<span  class='opc-paymentTax'>" . $this->currencyDisplay->createPriceDiv ('paymentTax', '', $this->cart->cartPrices['paymentTax'],True, FALSE) . "</span>" ?></li>
                <li class="result-title"><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_PAYMENT_COST') ?></li>
            </ul>
        </div>
        <?php if($this->cart->cartPrices['salesPriceCoupon']): ?>
        <div class="order-result">
            <ul>
                <li class="result-total"><?php echo "<span  class='opc-salesPriceCoupon'>" . $this->currencyDisplay->createPriceDiv ('salesPriceCoupon', '', $this->cart->cartPrices['salesPriceCoupon'], True,FALSE) . "</span>" ?></li>
                <li class="result-discount"><?php echo "<span  class='opc-billDiscountAmount'>" . $this->currencyDisplay->createPriceDiv ('billDiscountAmount', '', $this->cart->cartPrices['billDiscountAmount'], True,FALSE) . "</span>" ?> </li>
                <li class="result-tax"><?php echo "<span  class='opc-couponTax'>" . $this->currencyDisplay->createPriceDiv ('couponTax', '', $this->cart->cartPrices['couponTax'], True,FALSE) . "</span>" ?></li>
                <li class="result-title"><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_COUPON_PRICE') ?></li>             
            </ul>
        </div>
        <?php endif; ?>
        <div class="order-result">
            <ul>
                <li class="result-total total"><span class="opc-billTotal"><?php echo $this->currencyDisplay->createPriceDiv ('billTotal', '', $this->cart->cartPrices['billTotal'],True, FALSE); ?></span></li>
                <li class="result-discount total"><?php echo "<span  class='opc-billDiscountAmount'>" . $this->currencyDisplay->createPriceDiv ('billDiscountAmount', '', $this->cart->cartPrices['billDiscountAmount'], True,FALSE) . "</span>" ?> </li>
                <li class="result-tax total"><?php echo "<span  class='opc-billTaxAmount'>" . $this->currencyDisplay->createPriceDiv ('billTaxAmount', '', $this->cart->cartPrices['billTaxAmount'], True,FALSE) . "</span>" ?></li>
                <li class="result-title total"><?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_TOTAL_PRICE') ?></li>             
            </ul>
        </div>
      <!--  <div class="order-coupon-code">
            <input name="coupon_code" placeholder="<?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_COUPON_TEXT') ?>" maxlength="50" class="couponOpc" alt="<?php echo JText::_('SYSTEM_ONESTEPCHECKOUT_COUPON_TEXT') ?>" />
            <span id="addCouponCode">Save</span>
            <span><?php if($this->cart->couponCode) echo $this->cart->couponCode ?></span>
        </div>-->
    </div>
<script>
$(function(){
$('.quantity-plus,.quantity-minus').on('click',function() {
var
signs={'quantity-plus':1,'quantity-minus':-1},
el=$(this).parent().prev('.quantity-input'),
step=parseInt(el.attr('onblur').replace(/[^\d]/g,'')) || 1,
cls=$(this).attr('class'),
cl=cls.substring(cls.indexOf(' ')).trim(),
val=parseInt(el.val())+signs[cl]*step
;
val=val<step?step:val;
el.val(val);
$(this).parent().nextAll('span').filter('.vm2-add_quantity_cart').first().click();
});
});
</script>
</form>


« Последнее редактирование: 08.01.2019, 17:03:26 от Dolphin4ik_1 »
*

Dolphin4ik_1

  • Захожу иногда
  • 433
  • 3 / 2
вот пациент http://livrare-balti.md/ru/shop/shopping-cart.html

Кнопки добавил значение он принимает нужно но вот плюсом и минусом ничего не добавляет(
« Последнее редактирование: 08.01.2019, 17:02:59 от Dolphin4ik_1 »
*

Dolphin4ik_1

  • Захожу иногда
  • 433
  • 3 / 2
Можеткто нибудь подскажет что дописать для кнопок
*

Dolphin4ik_1

  • Захожу иногда
  • 433
  • 3 / 2
написал вот так

Код
		<p></p>
<form style="display: inline;" action="" method="post">
 <input name="option" type="hidden" value="com_virtuemart">
 <input class="quantity_btn quantity_m" type="button" value="-">
 <input id="quantity_<?php echo $pkey; ?>" class="quantity_product" name="quantity[<?php echo $pkey; ?>]" size="3"  type="text" value="<?php echo $pvalue->quantity ?>">
 <input class="quantity_btn inputbox quantity_p" type="button" value="+">
<input class="quantity_plus" type="button" value="+"> 
 <input name="view" type="hidden" value="cart">
 <input name="task" type="hidden" value="update">
 <input name="quantity[<?php echo $pkey; ?>]" type="hidden" value="">
 <input class="updatebtn" title="" name="update" type="submit" value=" ">
 <a class="deletebtn" title=""></a></form>
<p></p>
<script>
$document = JFactory::getDocument();
// Add Javascript
$document->addScriptDeclaration(
jQuery(function($){
$(".quantity_product").on("blur", function(){
var qn_id = document.getElementById($(this).attr("id"));
if (parseInt($(this).val()) > 0) {
OPCCMSMART.updateProduct(qn_id, parseInt($(this).val()));
}
});
$(".quantity_m").on("click", function(){
var qn = $(this).parent().find('.quantity_product');
var qn_id = document.getElementById(qn.attr('id'));
if (parseInt(qn.val()) > 1) {
  OPCCMSMART.updateProduct(qn_id, parseInt(qn.val()) - 1);
});
$('.quantity_p').on('click', function(){
var rParent = $(this).parent().parent();
var qn = $(this).rParent().find('.quantity_product');
var qn_id = document.getElementById(qn.attr('id'));
OPCCMSMART.updateProduct(qn_id, parseInt(qn.val()) + 1);
});
});

</script>

Но ни фига не пашет, помогите люди добрые)
*

Dolphin4ik_1

  • Захожу иногда
  • 433
  • 3 / 2
« Последнее редактирование: 15.01.2019, 10:21:39 от Dolphin4ik_1 »
*

Dolphin4ik_1

  • Захожу иногда
  • 433
  • 3 / 2
Решено

Сработал вот такой код, решение подсмотрел в разделе JoomShopping

Код
<span class="update-quantity"><input class="quantity-minus" style = "float:left;" value = "<" type="button" onclick="var qty_el = document.getElementById('quantity_<?php echo $pkey; ?>'); var qty = qty_el.value; if( !isNaN( qty ) && qty > 1 ) qty_el.value--;return false;"></span>
<span class="update-quantity"><input class="quantity-plus" style = "float:right;" value = ">" type="button" onclick="var qty_el = document.getElementById('quantity_<?php echo $pkey; ?>'); var qty = qty_el.value; if( !isNaN( qty )) qty_el.value++;return false;"></span>

<input type="text" value="<?php echo $pvalue->quantity ?>" name="quantity[<?php echo $pkey; ?>]" id="quantity_<?php echo $pkey; ?>" class="quantity_product" />
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Плагин поиска Virtuemat по настраиваемым полям

Автор SolopoV

Ответов: 3
Просмотров: 965
Последний ответ 13.02.2023, 20:37:39
от sivers
Передать содержимое настраиваемого поля(плагин) в письмо юзеру и админу

Автор IToro82

Ответов: 1
Просмотров: 1245
Последний ответ 26.02.2021, 16:51:33
от IToro82
Расчет общего веса заказа в корзине VirtueMart 3.6

Автор Valderdag

Ответов: 8
Просмотров: 961
Последний ответ 01.05.2020, 10:29:02
от Valderdag
Как вывести кнопку "добавить в корзину" на странице категории в VirtueMart 3?

Автор lav61

Ответов: 7
Просмотров: 2071
Последний ответ 30.03.2018, 11:08:34
от lexxbry
VirtueMart 3.2.4 после заказа товара удалять его с сайта?

Автор ejik_off

Ответов: 2
Просмотров: 1312
Последний ответ 05.12.2017, 18:37:40
от ejik_off