Jump to content

Recommended Posts



1 Можно сделать, чтобы при нажатии на кнопку предложить цену  к наименованию товара добавлялась опция?

2 Изменение цены в зависимости от опции?


как на этом сайте



Цена и сроки?


С уважением,


Share this post

Link to post
Share on other sites

Здравствуйте, Татьяна! Я смогу помочь с Вашим заданием, но мне нужно уточнить детали. Можем обсудить их по скайпу. Мой скайп project-panda-code  или напишите свой SkypeID. Спасибо)

Share this post

Link to post
Share on other sites

Я нашла код в файл fast_order.xml

Где мне его поставить?


<script type="text/javascript">
         function upd() {
var tmp='';
        var scv = $(this).find('option:selected').html();
        var rcv = $(this).find('input:radio:checked').next('label:first').html();
        var ccv = $(this).find('input:checkbox:checked').next('label:first').html();
        if (scv!==null){
        tmp +=$(this).find('b').text()+" "+scv+"; ";
        if (rcv!==null){
        tmp +=$(this).find('b').text()+" "+rcv+"; ";
        if (ccv!==null){
        tmp +=$(this).find('b').text()+" "+ccv+"; ";
var tovar = '';
        if ($('#options').val()!=='') {tovar +="<br>Опции: " + $('#options').val();}
        tovar += "<br>Количество: " + $('#quantity').val();
        tovar += "<br>Цена(за шт.): " + $('#product_price').val() + "; ";        
        $('#order').append('<span id="tovar"><br>'+tovar+'</span>');              


Мой файл fast_order.xml


    <id>Free fast order</id>
    <author>RGB, modified sv2109@gmail.com</author>
    <file name="catalog/view/theme/Zerocart-orange/template/common/header.tpl">
            <search position="before">
        <link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/fast_order.css" />
  <file name="catalog/controller/product/product.php">
      <search position="before">
      <![CDATA[$this->data['button_continue'] = $this->language->get('button_continue');]]>
$this->data['fo_button'] = $this->language->get('fo_button');
$this->data['fo_submit'] = $this->language->get('fo_submit');
$this->data['fo_title'] = $this->language->get('fo_title');
$this->data['fo_name'] = $this->language->get('fo_name');
$this->data['fo_phone'] = $this->language->get('fo_phone');
$this->data['fo_comment'] = $this->language->get('fo_comment');
$this->data['fo_help'] = $this->language->get('fo_help');
$this->data['fo_success'] = $this->language->get('fo_success');
$this->data['fo_recall'] = $this->language->get('fo_recall');
$this->data['fo_close'] = $this->language->get('fo_close');
$this->data['fo_error'] = $this->language->get('fo_error');
    <file name="catalog/view/theme/Zerocart-orange/template/product/product.tpl">
            <search position="after">
                <input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button" />
                <a id="fast_order" class="button" href="#fast_order_form" onclick="javascript: upd();" /><?php echo $fo_button; ?></a>
                <div style="display:none">
          <div id="fast_order_form">       
            <input id="product_name" type="hidden" value="<?php echo $heading_title; ?>">
            <input id="product_model" type="hidden" value="<?php echo $model; ?>">
            <input id="product_price" type="hidden" value="">
            <input id="qty" type="hidden" value="1">
            <input id="options" type="hidden" value="">
            <div class="fast_order_center"><?php echo $fo_title; ?> <?php echo $heading_title; ?></div>
            <div class="fast_order_left">
              <p><span class="required">*</span><?php echo $fo_name; ?></p>
              <p><span class="required">*</span><?php echo $fo_phone; ?></p>
              <p><span class="required">*</span><?php echo $fo_comment; ?></p>
            <div class="fast_order_right">
              <p><input type="text" id="customer_name"/></p>
              <p><input type="text" id="customer_phone"/></p>
              <p><input type="text" id="customer_message"/></p>
            <div class="fast_order_center">
              <p id="fast_order_result"><?php echo $fo_help; ?></p>
              <div id="fast_go"><button class="fast_order_button"><span><?php echo $fo_submit; ?></span></button></div>
<script type="text/javascript"><!--
$(document).ready(function () {
    $('#fast_order').colorbox({href:function(){ return $(this).attr('to'); },inline:true, width:"650px", height:"330px", title:" "});
    $('.fast_order_button').click(function () {
      var product_name = $('#product_name').val();
      var product_price = $('#product_price').val();
      var product_model = $('#product_model').val();
      var customer_name = $('#customer_name').val();
      var customer_phone = $('#customer_phone').val();
      var customer_message = $('#customer_message').val();
      $('#result').html('Обрабатываем введенные данные..');
      $.post('http://localhost/mebel/upload/fast_order.php' {
        'product_name': product_name,
        'product_price': product_price,
        'product_model': product_model,
        'customer_name': customer_name,
        'customer_phone': customer_phone,
        'customer_message': customer_message
        function (data) {
        if (data == 'empty') {
          $('#fast_order_result').html('<span class="fast_order_error"><?php echo $fo_error; ?></span>');
        else {
          $('#fast_order_result').html('<span class="fast_order_success"><?php echo $fo_success; ?></span><br /><span><?php echo $fo_recall; ?> <a onclick="$(window).colorbox.close();"><?php echo $fo_close; ?></a></span>');

Share this post

Link to post
Share on other sites

кидайте длинные коды под спойлер. Удобнее тему смотреть. 

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.


Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.