Fórum OpenCart Brasil

Por um e-commerce livre, confiável e profissional

Suporte para Módulos e Caixas Laterais.
Por Victor Honorato
#61205
Amigos,

Gostaria da ajuda de algum de vocês que me auxilie na edição do arquivo openstock_customise.xml na pasta do vqmod, para que este modulo funcione junto com o tema Pav dress, pois comprei este modulo, no meu tema ele não aparece a disponibilidade em estoque do produto na pagina do produto, e esta função é muito importante para minha loja online, estou a disposição! abraços e desde já agradeço!


contato: vgrevett@gmail.com
Por Victor Honorato
#61216
product.tpl
Código: Selecionar todos
<?php require( DIR_TEMPLATE.$this->config->get('config_template')."/template/common/config.tpl" );
  $themeConfig = $this->config->get('themecontrol');
  $productConfig = array(
      'product_enablezoom'=>1,
      'product_zoommode'  => 'basic',
      'product_zoomeasing' => 1,
      'product_zoomlensshape' => "round",
      'product_zoomlenssize' => "150",
      'product_zoomgallery'  => 0,

  );
  $productConfig = array_merge( $productConfig, $themeConfig );
	$listConfig = array(

		'category_pzoom' => 0
	);

	$listConfig = array_merge( $listConfig, $themeConfig );
	$categoryPzoom = $listConfig['category_pzoom'];
?>
<?php echo $header; ?>
<div id="breadcrumb">
  <div class="container">
    <div class="breadcrumb" style="color: #fff">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
    </div>

  </div>
</div>

<div id="group-content">
<?php if( $SPAN[0] ): ?>
  <div class="span<?php echo $SPAN[0];?>">
    <?php echo $column_left; ?>
  </div>
<?php endif; ?>
<div class="span<?php echo $SPAN[1];?>">
<div id="content"><?php echo $content_top; ?>


  <div class="product-info">
  <div class="row-fluid">
 <?php if ($thumb || $images) { ?>
    <div class="span5 image-container">


        <?php if ($thumb) { ?>
        <div class="image">
	       <?php if( $special )  { ?>
          <div class="product-label-special label">
            <span><?php echo $this->language->get( 'text_sale' ); ?></span>
          </div>
        <?php } ?>
	<a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="colorbox">
          <img src="<?php echo $thumb; ?>" title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" id="image"  data-zoom-image="<?php echo $popup; ?>" class="product-image-zoom"/></a></div>
        <?php } ?>
        <?php if ($images) { ?>
        <div class="image-additional slide carousel" id="image-additional"><div class="carousel-inner">
        <?php
        if( $productConfig['product_zoomgallery'] == 'slider' && $thumb ) {
          $eimages = array( 0=> array( 'popup'=>$popup,'thumb'=> $thumb )  );
          $images = array_merge( $eimages, $images );
        }
        $icols = 3; $i= 0;
        foreach ($images as  $image) { ?>
          <?php if( (++$i)%$icols == 1 ) { ?>
          <div class="item">
          <?php } ?>

              <a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="colorbox" data-zoom-image="<?php echo $image['popup']; ?>" data-image="<?php echo $image['popup']; ?>">
                <img src="<?php echo $image['thumb']; ?>" style="max-width:<?php echo $this->config->get('config_image_additional_width');?>px"  title="<?php echo $heading_title; ?>" alt="<?php echo $heading_title; ?>" data-zoom-image="<?php echo $image['popup']; ?>" class="product-image-zoom" />
              </a>
            <?php if( $i%$icols == 0 || $i==count($images) ) { ?>
              </div>
          <?php } ?>
        <?php } ?>
      </div>
            <div class="carousel-control left" href="#image-additional" data-slide="prev">&lsaquo;</div>
        <div class="carousel-control right" href="#image-additional" data-slide="next">&rsaquo;</div>
        </div>


          <script type="text/javascript">
            $('#image-additional .item:first').addClass('active');
            $('#image-additional').carousel({interval:false})
          </script>

        <?php } ?>


    </div>
    <?php } ?>
    <div class="span7">
      <div class="product-info-item">
     <h2 class="h2-exo"><span><?php echo $heading_title; ?></span></h2>

      <div class="price-info">
        <?php if ($price) { ?>
          <div class="price">
           <?php if (!$special) { ?>
              <?php echo $price; ?>
              <?php } else { ?>
              <span class="price-old"><?php echo $price; ?></span> <span class="price-new"><?php echo $special; ?></span>
              <?php } ?>
          </div>
      <?php } ?>

        <?php if ($minimum > 1) { ?>
          <div class="minimum"><?php echo $text_minimum; ?></div>
        <?php } ?>
        <?php if ($price) { ?>
      <div class="price-other"><?php //echo $text_price; ?>

        <?php if ($tax) { ?>
        <span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span><br />
        <?php } ?>
        <?php if ($points) { ?>
        <span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span><br />
        <?php } ?>
        <?php if ($discounts) { ?>
        <br />
        <div class="discount">
          <?php foreach ($discounts as $discount) { ?>
          <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><br />
          <?php } ?>
        </div>
        <?php } ?>
      </div>
      <?php } ?>


      </div>

     <div class="addition-actions">
       <span class="cart-info product-extra">
          <span class="quantity-adder">
          <?php echo $text_qty; ?>

          <input type="text" name="quantity" size="2" value="<?php echo $minimum; ?>" />
            <span class="add-up add-action"><span class="icon-plus"></span></span>
            <span class="add-down add-action"><span class="icon-minus"></span></span>
          </span>
          <input type="hidden" name="product_id" size="2" value="<?php echo $product_id; ?>" />
          &nbsp;

         <!-- <span>&nbsp;&nbsp;<?php //echo $text_or; ?>&nbsp;&nbsp;</span> -->
          </span>
    </div>

      <?php if ($review_status) { ?>
      <div class="review">

        <div>
          <img src="catalog/view/theme/<?php echo $this->config->get('config_template');?>/image/stars-<?php echo $rating; ?>.png" alt="<?php echo $reviews; ?>" />&nbsp;&nbsp;<a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $reviews; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('a[href=\'#tab-review\']').trigger('click');"><?php echo $text_write; ?></a>
        </div>


      </div>
      <?php } ?>

      <div class="description">
        <?php if ($manufacturer) { ?>
        <span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
        <?php } ?>
        <span><?php echo $text_model; ?></span> <?php echo $model; ?><br />
        <?php if ($reward) { ?>
        <span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
        <?php } ?>
        <span><?php echo $text_stock; ?></span> <?php echo $stock; ?> </div>


        <div class="group-action">
          <div class="cart">
            <input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button" />
          </div>
          <div class="wishlist">
            <a class="pavicon-wishlist" onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a>
          </div>
          <div class="compare">
            <a class="pavicon-compare" onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a>
          </div>
        </div>

      <?php if ($options) { ?>
      <div class="options">
        <h2 class="h2-exo"><?php echo $text_option; ?></h2>
        <br />

        <?php foreach ($options as $option) { ?>
        <?php if ($option['type'] == 'select') { ?>
          <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
            <?php if ($option['required']) { ?>
            <span class="required">*</span>
            <?php } ?>
            <b><?php echo $option['name']; ?>:</b><br />
            <select name="option[<?php echo $option['product_option_id']; ?>]">
              <option value=""><?php echo $text_select; ?></option>
              <?php foreach ($option['option_value'] as $option_value) { ?>
              <option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
              <?php if ($option_value['price']) { ?>
              (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
              <?php } ?>
              </option>
              <?php } ?>
            </select>
          </div>

        <br />
        <?php } ?>
        <?php if ($option['type'] == 'radio') { ?>
          <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
            <?php if ($option['required']) { ?>
            <span class="required">*</span>
            <?php } ?>
            <b><?php echo $option['name']; ?>:</b><br />
            <?php foreach ($option['option_value'] as $option_value) { ?>
            <input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
            <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
              <?php if ($option_value['price']) { ?>
              (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
              <?php } ?>
            </label>
            <br />
            <br />
            <?php } ?>
          </div>
        <br />
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'checkbox') { ?>
          <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
            <?php if ($option['required']) { ?>
            <span class="required">*</span>
            <?php } ?>
            <b><?php echo $option['name']; ?>:</b><br />
            <?php foreach ($option['option_value'] as $option_value) { ?>
            <input type="checkbox" name="option[<?php echo $option['product_option_id']; ?>][]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" />
            <label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
              <?php if ($option_value['price']) { ?>
              (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
              <?php } ?>
            </label>
            <br />
            <?php } ?>
          </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'image') { ?>
          <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
            <?php if ($option['required']) { ?>
            <span class="required">*</span>
            <?php } ?>
            <b><?php echo $option['name']; ?>:</b><br />
            <table class="option-image">
              <?php foreach ($option['option_value'] as $option_value) { ?>
              <tr>
                <td style="width: 1px;"><input type="radio" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option_value['product_option_value_id']; ?>" id="option-value-<?php echo $option_value['product_option_value_id']; ?>" /></td>
                <td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><img src="<?php echo $option_value['image']; ?>" alt="<?php echo $option_value['name'] . ($option_value['price'] ? ' ' . $option_value['price_prefix'] . $option_value['price'] : ''); ?>" /></label></td>
                <td><label for="option-value-<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?>
                    <?php if ($option_value['price']) { ?>
                    (<?php echo $option_value['price_prefix']; ?><?php echo $option_value['price']; ?>)
                    <?php } ?>
                  </label></td>
              </tr>
              <?php } ?>
            </table>
        </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'text') { ?>
          <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
            <?php if ($option['required']) { ?>
            <span class="required">*</span>
            <?php } ?>
            <b><?php echo $option['name']; ?>:</b><br />
            <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" />
          </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'textarea') { ?>
          <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
            <?php if ($option['required']) { ?>
            <span class="required">*</span>
            <?php } ?>
            <b><?php echo $option['name']; ?>:</b><br />
            <textarea name="option[<?php echo $option['product_option_id']; ?>]" cols="40" rows="5"><?php echo $option['option_value']; ?></textarea>
          </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'file') { ?>
          <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
            <?php if ($option['required']) { ?>
            <span class="required">*</span>
            <?php } ?>
            <b><?php echo $option['name']; ?>:</b><br />
            <input type="button" value="<?php echo $button_upload; ?>" id="button-option-<?php echo $option['product_option_id']; ?>" class="button">
            <input type="hidden" name="option[<?php echo $option['product_option_id']; ?>]" value="" />
          </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'date') { ?>
          <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
            <?php if ($option['required']) { ?>
            <span class="required">*</span>
            <?php } ?>
            <b><?php echo $option['name']; ?>:</b><br />
            <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="date" />
          </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'datetime') { ?>
          <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
            <?php if ($option['required']) { ?>
            <span class="required">*</span>
            <?php } ?>
            <b><?php echo $option['name']; ?>:</b><br />
            <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="datetime" />
          </div>
        <br />
        <?php } ?>
        <?php if ($option['type'] == 'time') { ?>
          <div id="option-<?php echo $option['product_option_id']; ?>" class="option">
            <?php if ($option['required']) { ?>
            <span class="required">*</span>
            <?php } ?>
            <b><?php echo $option['name']; ?>:</b><br />
            <input type="text" name="option[<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['option_value']; ?>" class="time" />
          </div>
        <br />
        <?php } ?>
        <?php } ?>
      </div>
      <?php } ?>

      <?php if ($tags) { ?>
      <div class="tags"><b><?php echo $text_tags; ?></b>
        <?php for ($i = 0; $i < count($tags); $i++) { ?>
        <?php if ($i < (count($tags) - 1)) { ?>
        <a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a>,
        <?php } else { ?>
        <a href="<?php echo $tags[$i]['href']; ?>"><?php echo $tags[$i]['tag']; ?></a>
        <?php } ?>
        <?php } ?>
      </div>
      <?php } ?>


    </div>
  </div>
  </div>
</div>
  <div class="tabs-group">
  <div id="tabs" class="htabs"><a href="#tab-description"><?php echo $tab_description; ?></a>
    <?php if ($attribute_groups) { ?>
    <a href="#tab-attribute"><?php echo $tab_attribute; ?></a>
    <?php } ?>
    <?php if ($review_status) { ?>
    <a href="#tab-review"><?php echo $tab_review; ?></a>
    <?php } ?>

  </div>
  <div id="tab-description" class="tab-content"><?php echo $description; ?></div>
  <?php if ($attribute_groups) { ?>
  <div id="tab-attribute" class="tab-content">
    <table class="attribute">
      <?php foreach ($attribute_groups as $attribute_group) { ?>
      <thead>
        <tr>
          <td colspan="2"><?php echo $attribute_group['name']; ?></td>
        </tr>
      </thead>
      <tbody>
        <?php foreach ($attribute_group['attribute'] as $attribute) { ?>
        <tr>
          <td><?php echo $attribute['name']; ?></td>
          <td><?php echo $attribute['text']; ?></td>
        </tr>
        <?php } ?>
      </tbody>
      <?php } ?>
    </table>
  </div>
  <?php } ?>
  <?php if ($review_status) { ?>
  <div id="tab-review" class="tab-content">
    <div id="review"></div>
    <h2 id="review-title"><?php echo $text_write; ?></h2>
    <b><?php echo $entry_name; ?></b><br />
    <input type="text" name="name" value="" />
    <br />
    <br />
    <b><?php echo $entry_review; ?></b>
    <textarea name="text" cols="40" rows="8" style="width: 98%;"></textarea>
    <span style="font-size: 11px;"><?php echo $text_note; ?></span><br />
    <br />
    <b><?php echo $entry_rating; ?></b> <span><?php echo $entry_bad; ?></span>&nbsp;
    <input type="radio" name="rating" value="1" />
    &nbsp;
    <input type="radio" name="rating" value="2" />
    &nbsp;
    <input type="radio" name="rating" value="3" />
    &nbsp;
    <input type="radio" name="rating" value="4" />
    &nbsp;
    <input type="radio" name="rating" value="5" />
    &nbsp;<span><?php echo $entry_good; ?></span><br />
    <br />
    <b><?php echo $entry_captcha; ?></b><br /> <br />
  <img src="index.php?route=product/product/captcha" alt="" id="captcha" />
    <br />
      <br />
    <input type="text" name="captcha" value="" />
    <br />
       <br />
    <div>
      <div class="pull-right"><a id="button-review" class="button"><?php echo $button_continue; ?></a></div>
    </div>
  </div>
  <?php } ?>
  </div>

    <?php if ($products) { ?>

  <div class="product-related">
   <span class="title-related"><?php echo $tab_related; ?> (<?php echo count($products); ?>)</span>
  <div id="related" class="slide" data-interval="0">
    <div class="carousel-controls">
      <a class="carousel-control left" href="#related" data-slide="prev">&lsaquo;</a>
      <a class="carousel-control right" href="#related" data-slide="next">&rsaquo;</a>
    </div>
<div class="carousel-inner">
    <?php
	$max_related_column = 3;
	if( isset($productConfig['product_related_column']) && $productConfig['product_related_column'] ){
		$max_related_column = $productConfig['product_related_column'];
	}
  $cols = $max_related_column;
    $span = floor(12/$cols);
  foreach ($products as $i => $product) { ?>
        <?php if( $i++%$cols == 0 ) { ?>
                <div class="item <?php if($i==1) {?>active<?php } ?>">
          <div class="row-fluid">
        <?php } ?>
    <div class="span<?php echo $span;?> product-block">

      <div class="product-inner">
      <?php if ($product['thumb']) { ?>
      <div class="image">
  	   <?php if( $product['special'] ) {   ?>
      <div class="product-label-special label">
        <span><?php echo $this->language->get( 'text_sale' ); ?></span>
      </div>
      <?php } ?>
        <a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a>
        <?php if( $categoryPzoom ) { $zimage = str_replace( "cache/","", preg_replace("#-\d+x\d+#", "",  $product['thumb'] ));  ?>
        <a href="<?php echo $zimage;?>" class="colorbox product-zoom" rel="colorbox" title="<?php echo $product['name']; ?>"><span class="icon-zoom-in"></span></a>
        <?php } ?>
  		<?php if( $categoryPzoom ) { $zimage = str_replace( "cache/","", preg_replace("#-\d+x\d+#", "",  $product['thumb'] ));  ?>

  			<?php } ?>
        <div class="group-action">
          <div class="btn-overlay cart">
            <input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" />
          </div>
          <div class="btn-overlay wishlist">
            <a class="pavicon-wishlist" href="<?php echo $product['href']; ?>">VER PRODUTO</a>
          </div>
          <div class="btn-overlay compare">
            <a class="pavicon-compare" onclick="addToCompare('<?php echo $product['product_id']; ?>');"><?php echo $this->language->get("button_compare"); ?></a>
          </div>
        </div>
		</div>
      <?php } ?>
        <h4 class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h4>
        <?php if ($product['rating']) { ?>
        <div class="rating is-hover">
          <img src="catalog/view/theme/<?php echo $this->config->get('config_template');?>/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" />
        </div>
        <?php } ?>
        <?php if ($product['price']) { ?>
        <div class="price">
          <?php if (!$product['special']) { ?>
          <?php echo $product['price']; ?>
          <?php } else { ?>
          <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span>
          <?php } ?>
        </div>
        <?php } ?>
        <?php if ($error_warning) { ?>
        <div class="warning"><?php echo $error_warning; ?><img src="catalog/view/theme/<?php echo $this->config->get('config_template');?>/image/close.png" alt="" class="close" /></div>
        <?php } ?>
      </div>
    </div>
   <?php if( $i%$cols == 0 || $i==count($products) ) { ?>
   </div>
  </div>
   <?php } ?>

    <?php } ?>
  </div>
  </div>
  </div>
</div>
  <?php } ?>

  <?php echo $content_bottom; ?></div>
  <?php if( $productConfig['product_enablezoom'] ) { ?>
<script type="text/javascript" src=" catalog/view/theme/<?php echo $this->config->get('config_template'); ?>/javascript/elevatezoom/elevatezoom-min.js"></script>
<script type="text/javascript">
 <?php if( $productConfig['product_zoomgallery'] == 'slider' ) {  ?>
  $("#image").elevateZoom({gallery:'image-additional', cursor: 'pointer', galleryActiveClass: 'active'});
  <?php } else { ?>
  var zoomCollection = '<?php echo $productConfig["product_zoomgallery"]=="basic"?".product-image-zoom":"#image";?>';
   $( zoomCollection ).elevateZoom({
      <?php if( $productConfig['product_zoommode'] != 'basic' ) { ?>
      zoomType        : "<?php echo $productConfig['product_zoommode'];?>",
      <?php } ?>
      lensShape : "<?php echo $productConfig['product_zoomlensshape'];?>",
      lensSize    : <?php echo (int)$productConfig['product_zoomlenssize'];?>,

   });
  <?php } ?>
</script>
<?php } ?>
<script type="text/javascript"><!--
$(document).ready(function() {
  $('.colorbox').colorbox({
    overlayClose: true,
    opacity: 0.5,
    rel: "colorbox"
  });
});
//--></script>
<script type="text/javascript"><!--
$('#button-cart').bind('click', function() {
  $.ajax({
    url: 'index.php?route=checkout/cart/add',
    type: 'post',
    data: $('.product-info input[type=\'text\'], .product-info input[type=\'hidden\'], .product-info input[type=\'radio\']:checked, .product-info input[type=\'checkbox\']:checked, .product-info select, .product-info textarea'),
    dataType: 'json',
    success: function(json) {
      $('.success, .warning, .attention, information, .error').remove();

      if (json['error']) {
        if (json['error']['option']) {
          for (i in json['error']['option']) {
            $('#option-' + i).after('<span class="error">' + json['error']['option'][i] + '</span>');
          }
        }
      }

      if (json['warning']) {
        $('#notification').html('<div class="warning" style="display: none;">' + json['error']['warning'] + '<img src="catalog/view/theme/<?php echo $this->config->get('config_template');?>/image/close.png" alt="" class="close" /></div>');

        $('.warning').fadeIn('slow');

        $('html, body').animate({ scrollTop: 0 }, 'slow');
      }

      if (json['success']) {
        $('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');

        $('.success').fadeIn('slow');

        $('#cart-total').html(json['total']);

        $('html, body').animate({ scrollTop: 0 }, 'slow'); location.href = "index.php?route=checkout/cart";
      }
    }
  });
});
//--></script>
<?php if ($options) { ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/ajaxupload.js"></script>
<?php foreach ($options as $option) { ?>
<?php if ($option['type'] == 'file') { ?>
<script type="text/javascript"><!--
new AjaxUpload('#button-option-<?php echo $option['product_option_id']; ?>', {
  action: 'index.php?route=product/product/upload',
  name: 'file',
  autoSubmit: true,
  responseType: 'json',
  onSubmit: function(file, extension) {
    $('#button-option-<?php echo $option['product_option_id']; ?>').after('<img src="catalog/view/theme/default/image/loading.gif" class="loading" style="padding-left: 5px;" />');
    $('#button-option-<?php echo $option['product_option_id']; ?>').attr('disabled', true);
  },
  onComplete: function(file, json) {
    $('#button-option-<?php echo $option['product_option_id']; ?>').attr('disabled', false);

    $('.error').remove();

    if (json['success']) {
      alert(json['success']);

      $('input[name=\'option[<?php echo $option['product_option_id']; ?>]\']').attr('value', json['file']);
    }

    if (json['error']) {
      $('#option-<?php echo $option['product_option_id']; ?>').after('<span class="error">' + json['error'] + '</span>');
    }

    $('.loading').remove();
  }
});
//--></script>
<?php } ?>
<?php } ?>
<?php } ?>
<script type="text/javascript"><!--
$('#review .pagination a').live('click', function() {
  $('#review').fadeOut('slow');

  $('#review').load(this.href);

  $('#review').fadeIn('slow');

  return false;
});

$('#review').load('index.php?route=product/product/review&product_id=<?php echo $product_id; ?>');

$('#button-review').bind('click', function() {
  $.ajax({
    url: 'index.php?route=product/product/write&product_id=<?php echo $product_id; ?>',
    type: 'post',
    dataType: 'json',
    data: 'name=' + encodeURIComponent($('input[name=\'name\']').val()) + '&text=' + encodeURIComponent($('textarea[name=\'text\']').val()) + '&rating=' + encodeURIComponent($('input[name=\'rating\']:checked').val() ? $('input[name=\'rating\']:checked').val() : '') + '&captcha=' + encodeURIComponent($('input[name=\'captcha\']').val()),
    beforeSend: function() {
      $('.success, .warning').remove();
      $('#button-review').attr('disabled', true);
      $('#review-title').after('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');
    },
    complete: function() {
      $('#button-review').attr('disabled', false);
      $('.attention').remove();
    },
    success: function(data) {
      if (data['error']) {
        $('#review-title').after('<div class="warning">' + data['error'] + '</div>');
      }

      if (data['success']) {
        $('#review-title').after('<div class="success">' + data['success'] + '</div>');

        $('input[name=\'name\']').val('');
        $('textarea[name=\'text\']').val('');
        $('input[name=\'rating\']:checked').attr('checked', '');
        $('input[name=\'captcha\']').val('');
      }
    }
  });
});
//--></script>
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript"><!--
$(document).ready(function() {
  if ($.browser.msie && $.browser.version == 6) {
    $('.date, .datetime, .time').bgIframe();
  }

  $('.date').datepicker({dateFormat: 'yy-mm-dd'});
  $('.datetime').datetimepicker({
    dateFormat: 'yy-mm-dd',
    timeFormat: 'h:m'
  });
  $('.time').timepicker({timeFormat: 'h:m'});
});
//--></script>
<?php if( $SPAN[2] ): ?>
<div class="span<?php echo $SPAN[2];?>">
  <?php echo $column_right; ?>
</div>
<?php endif; ?>
</div>
<?php echo $footer; ?>

e o arquivo customize xml do openstock
Código: Selecionar todos
<?xml version="1.0" encoding="UTF-8"?>
<modification>
    <id>OpenStock template customise file</id>
    <version>178</version>
    <vqmver>2.4.1</vqmver>
    <author>Welford Media</author>
    <file name="catalog/view/theme/*/template/common/header.tpl">
        <operation>
            <search position="before"><![CDATA[<?php echo $google_analytics; ?>]]></search>
            <add><![CDATA[<style>.loading {background: #FFFFFF url('/catalog/view/theme/default/image/loading.gif') 10px center no-repeat;border: 1px solid #B8E2FB;	padding: 10px 10px 10px 33px;margin-bottom: 15px;color: #555555;}</style>]]></add>
        </operation>
    </file>
    <file name="catalog/view/theme/*/template/product/product.tpl">
        <operation>
            <search position="replace"><![CDATA[<span><?php echo $text_model; ?></span> <?php echo $model; ?>]]></search>
            <add><![CDATA[<span><?php echo $text_model; ?></span> <span class="os-sku" style="color:#4d4d4d"><?php echo $model; ?></span>]]></add>
        </operation>
		<operation>
            <search position="replace"><![CDATA[<span><?php echo $text_stock; ?></span> <?php echo $stock; ?>]]></search>
            <add><![CDATA[<?php if($has_option == 0 && $subtract != 0) { ?><span><?php echo $text_stock; ?></span> <?php echo $stock; ?> <?php } ?>]]></add>
        </operation>
        <operation>
            <search position="replace"><![CDATA[<select name="option]]></search>
            <add><![CDATA[<select class="optionChoice" name="option]]></add>
        </operation>
        <operation>
            <search position="replace"><![CDATA[<input type="radio" name="option]]></search>
            <add><![CDATA[<input class="optionChoice" type="radio" name="option]]></add>
        </operation>
        <operation>
            <search position="before" offset="2"><![CDATA[<div class="cart">]]></search>
            <add><![CDATA[<input type="hidden" name="optionNumbers" value="<?php echo $i; ?>" id="optionNumbers" />]]></add>
        </operation>
       <operation>
            <search position="before"><![CDATA[<?php echo $text_qty; ?>]]></search>
            <add><![CDATA[<div id="product-cart">]]></add>
        </operation>
        <operation>
            <search position="before"><![CDATA[<div><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />]]></search>
            <add><![CDATA[</div>]]></add>
        </operation>
        <!-- you can remove the radio button but users dont know if they have selected anything!
        <operation>
            <search position="replace"><![CDATA[<td style="width: 1px;">]]></search>
            <add><![CDATA[<td style="display:none;">]]></add>
        </operation>
        -->
        <!-- FOR TEMPLATE CUSTOMISATION YOU SHOULD NOT NEED TO MODIFY BELOW HERE -->
        <operation>
            <search position="replace"><![CDATA[foreach ($options as $option) { ?>]]></search>
            <add><![CDATA[$i = 0; foreach ($options as $option) { ?>]]></add>
        </operation>
        <operation>
            <search position="replace"><![CDATA[<?php if ($option['type'] == 'radio') { ?>]]></search>
            <add><![CDATA[<?php if ($option['type'] == 'radio') { $i++;?>]]></add>
        </operation>
        <operation>
            <search position="replace"><![CDATA[<?php if ($option['type'] == 'select') {]]></search>
            <add><![CDATA[<?php if ($option['type'] == 'select') { $i++;]]></add>
        </operation>
        <operation>
            <search position="replace"><![CDATA[<?php if ($option['type'] == 'image') {]]></search>
            <add><![CDATA[<?php if ($option['type'] == 'image') { $i++;]]></add>
        </operation>
        <operation>
            <search position="replace"><![CDATA[<?php if ($option_value['price']) { ?>]]></search>
            <add><![CDATA[<?php if ($option_value['price'] && $has_option != 1) { ?>]]></add>
        </operation>
        <operation>
            <search position="before"><![CDATA[<?php echo $footer; ?>]]></search>
            <add><![CDATA[
<?php if ($has_option == 1) { ?>
    <script type="text/javascript"><!--
    $('.optionChoice').change(function(){
        var optionStr = '';
        var i = parseInt(0);
        var optionNumbers = $('#optionNumbers').val();
        var imgThumbOriginal = '<?php echo $thumb; ?>';
        var imgPopOriginal = '<?php echo $popup; ?>';
        var stringPrice = ''; var stringDiscount = '';

        $(".optionChoice option:selected, input:radio[class=optionChoice]:checked").each(function(){
            if($(this).val() != '')
            {
                if(i != 0){optionStr = optionStr +':'+ $(this).val();}else{optionStr = $(this).val();}
                i++;
            }
        });

        if(i == optionNumbers){
            $.ajax({
                type: 'POST',
                url: 'index.php?route=openstock/openstock/optionStatus',
                dataType: 'json',
                data: 'var=' + optionStr + '&product_id=<?php echo $product_id; ?>',
                beforeSend: function() {
                    $('.success, .warning').remove();
                    $('.options').before('<div class="loading"><?php echo $text_checking_options; ?></div>');
                    $('.product-info .price').html('').hide();
                },
                complete: function() {},
                success: function(data) {
                    setTimeout(function() {
                        if (data.error) {
                            $('.loading').removeClass('loading').addClass('warning').empty().text(data.error);
                            $('#product-cart').hide();
                            return;
                        }

                        stringPrice = '<?php echo $text_price; ?> ';

                        if (data.data.originaltax != data.data.pricetax) {
                            stringPrice += '<span class="price-old">'+data.data.originaltax+'</span> ';
                        }

                        stringPrice += data.data.pricetax+'<br /><?php if ($tax) { ?><span class="price-tax"><?php echo $text_tax; ?> '+data.data.price+'</span><?php } ?>';

                        stringDiscount = '';
                        if (data.data.discount) {
                            stringDiscount = '<br /><div class="discount">';
                            $.each(data.data.discount, function(discountKey, discountAmt) {
                                stringDiscount += discountAmt+'<br />';
                            });
                            stringDiscount += '</div>';
                        }

                        if (data.data.nodiscount) {
                            stringDiscount = '<br /><div class="discount">'+data.data.nodiscount+'</div>';
                        }

                        if (data.success) {
                            $('.loading').removeClass('loading').addClass('success').empty().text(data.success);
                            $('.product-info .price').html(stringPrice).append(stringDiscount).show();
                            $('#product-cart').show();
                        }

                        if (data.nostock) {
                            $('.loading').removeClass('loading').addClass('warning').empty().text(data.nostock);
                            $('.product-info .price').html(stringPrice).append(stringDiscount).show();

                            if (data.nostockcheckout == 1) {
                                $('#product-cart').show();
                            }else{
                                $('#product-cart').hide();
                            }
                        }

                        if (data.notactive) {
                            $('.loading').removeClass('loading').addClass('warning').empty().text(data.notactive);
                            $('.product-info .price').html(stringPrice).append(stringDiscount).show();
                            $('#product-cart').hide();
                        }

						if (data.data.sku != '') {
							$('.product-info .os-sku').html(data.data.sku);
						} else {
							$('.product-info .os-sku').html('<?php echo $model; ?>');
						}

                        if (data.data.image != '') {
                            $('.product-info #image').attr('src', data.data.thumb);
                            $('.product-info .image a').attr('href', data.data.pop);
                        } else {
                            $('.product-info #image').attr('src', imgThumbOriginal);
                            $('.product-info .image a').attr('href', imgPopOriginal);
                        }
                    }, 500);
                }
            });
        }
    });

    <?php if ($has_option == 1 && $openstock_show_default_price == '0'){ ?> $(function() { $('.product-info .price').html('').hide(); }); <?php } ?>

    //--></script>
<?php } ?>
]]></add>
        </operation>
    </file>
</modification>

O problema é que na página do produto quando faz a seleção do tamanho logo em seguida a cor, ele não acusa se tem em estoque ou não... ele deixa adicionar no carrinho e só acusa lá no carrinho se o item tem estoque ou não colocando uma mensagem de erro com ***.
Por Victor Honorato
#61221
Coloquei la mas não aconteceu nada, não mostra nenhum informação do estoque do produto selecionado e quando selecionado um produto sem estoque ele deixar adicionar no carrinho e só acusa sem estoque lá.

Estou no skype também se você tiver e puder me ajudar. skype: pkboludo
Avatar do usuário
Por matheusdacs
#61446
Conseguiu resolver o problema? caso não tenha conseguido, va na pasta da sua loja e depois em vqmod/logs e copie o ultimo arquivo para que possamos analisar.
Por erickleandrolima
#63663
Estou com o mesmo problema, o produto não existe no estoque, porém só acusa no momento do checkout, e a minha cliente quer que não seja possível colocar no carrinho um produto que não exista no estoque. segue o meu log do vqmod conforme solicitado:

---------- Date: 2015-09-17 02:09:48 ~ IP : 179.177.41.25 ----------
REQUEST URI : /legging-recorte-princes
MOD DETAILS:
modFile : /home/lilifitnesscom/public_html/vqmod/xml/openstock_customise.xml
id : OpenStock template customise file
version : 178
vqmver : 2.4.1
author : Welford Media

File Name : catalog/view/theme/*/template/product/product.tpl(0)
VQModObject::applyMod - SEARCH NOT FOUND (ABORTING MOD): <span><?php echo $text_model; ?></span> <?php echo $model; ?>

MOD DETAILS:
modFile : /home/lilifitnesscom/public_html/vqmod/xml/parcelamento_e_desconto_boleto.xml
id : Parcelamento do valor do produto
version : 2.5.5
vqmver : 2.2.1
author : Joseanmatias.com.br

File Name : catalog/view/theme/*/template/product/product.tpl(1)
VQModObject::applyMod - SEARCH NOT FOUND (SKIPPED): <span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>

----------------------------------------------------------------------


---------- Date: 2015-09-17 02:25:34 ~ IP : 177.0.141.136 ----------
REQUEST URI : /regata-interloque-machao
MOD DETAILS:
modFile : /home/lilifitnesscom/public_html/vqmod/xml/parcelamento_e_desconto_boleto.xml
id : Parcelamento do valor do produto
version : 2.5.5
vqmver : 2.2.1
author : Joseanmatias.com.br

File Name : catalog/view/theme/*/template/product/product.tpl(1)
VQModObject::applyMod - SEARCH NOT FOUND (SKIPPED): <span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>

----------------------------------------------------------------------
Avatar do usuário
Por valdeir2000
Mensagens Especiais
#63671
O erro está na linha
Código: Selecionar todos
<span><?php echo $text_model; ?></span> <?php echo $model; ?>
do arquivo vqmod/xml/openstock_customise.xml

Sugiro que abra o arquivo catalog/view/theme/*/template/product/product.tpl > Localize a linha em que possuo o código abaixo
Código: Selecionar todos
<?php echo $model; ?>
e substitua no a linha
Código: Selecionar todos
<span><?php echo $text_model; ?></span> <?php echo $model; ?>
do arquivo vqmod/xml/openstock_customise.xml pela linha encontrada no arquivo catalog/view/theme/*/template/product/product.tpl

Acho que deu pra entender.

Olá; Esse método de comprar sem cad[…]

Criar Módulos OpenCart

Bom dia pessoal, tudo bem. Estou a algum tempo pe[…]

Mudar nome do Destaque

Muito obrigado amigo! Resolveu!

obrigado Manoel, me ajudou muito. Então, o […]