Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Как реализовать подобное


 Share

Recommended Posts

Как реализовать html Блок в списке товаров(категории) (см. скрин ниже)

https://skazochnye-sny.ru/detskoe_postelnoe_bele/

 

1531331767831.png

Link to comment
Share on other sites


Вставить свой элемент в цикл вывода товаров. Даже позицию для модуля туда можно сунуть, наверное.

Link to comment
Share on other sites

2 минуты назад, mazein сказал:

Вставить свой элемент в цикл вывода товаров. Даже позицию для модуля туда можно сунуть, наверное.

Можно подробнее?)

Link to comment
Share on other sites


Вывод дополнительного поля в админке для ссылки на видео и вывод его в самом магазине.

Link to comment
Share on other sites

 <?php foreach ($products as $product) { ?>
  <div class="product-grid-item xs-100 sm-50 md-33 lg-33 xl-33">
      <div class="product-thumb product-wrapper <?php echo isset($product['labels']) && is_array($product['labels']) && isset($product['labels']['outofstock']) ? 'outofstock' : ''; ?>">
        <div class="image">
          <a href="<?php echo $product['href']; ?>" <?php if(isset($product['thumb2']) && $product['thumb2']): ?> class="has-second-image" style="background: url('<?php echo $product['thumb2']; ?>') no-repeat;" <?php endif; ?>>
              <img class="lazy first-image" src="<?php echo $this->journal2->settings->get('product_dummy_image'); ?>" data-src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" />
          </a>

          <?php if (isset($product['labels']) && is_array($product['labels'])): ?>
          <?php foreach ($product['labels'] as $label => $name): ?>
          <span class="label-<?php echo $label; ?>"><b><?php echo $name; ?></b></span>
          <?php endforeach; ?>
          <?php endif; ?>         
        </div>
        <div class="product-details">
          <div class="caption">
            <h4 class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></h4>
            <p class="description"><?php echo $product['description']; ?></p>
            <?php if ($product['rating']) { ?>
            <div class="rating">
              <?php for ($i = 1; $i <= 5; $i++) { ?>
              <?php if ($product['rating'] < $i) { ?>
              <span class="fa fa-stack"><i class="fa fa-star-o fa-stack-2x"></i></span>
              <?php } else { ?>
              <span class="fa fa-stack"><i class="fa fa-star fa-stack-2x"></i><i class="fa fa-star-o fa-stack-2x"></i></span>
              <?php } ?>
              <?php } ?>
            </div>
            <?php } ?>
            <?php if ($product['price']) { ?>
            <p 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 isset($product['date_end']) && $product['date_end'] ? "data-end-date='{$product['date_end']}'" : ""; ?>><?php echo $product['special']; ?></span>
              <?php } ?>
              <?php if ($product['tax']) { ?>
              <span class="price-tax"><?php echo $text_tax; ?> <?php echo $product['tax']; ?></span>
              <?php } ?>
            </p>
            <?php } ?>
          </div>
          <div class="button-group">
            <?php if (Journal2Utils::isEnquiryProduct($this, $product)): ?>
            <div class="cart enquiry-button">
              <a href="javascript:Journal.openPopup('<?php echo $this->journal2->settings->get('enquiry_popup_code'); ?>', '<?php echo $product['product_id']; ?>');" data-clk="addToCart('<?php echo $product['product_id']; ?>');" class="button hint--top" data-hint="<?php echo $this->journal2->settings->get('enquiry_button_text'); ?>"><?php echo $this->journal2->settings->get('enquiry_button_icon') . '<span class="button-cart-text">' . $this->journal2->settings->get('enquiry_button_text') . '</span>'; ?></a>
            </div>
            <?php else: ?>
            <div class="cart <?php echo isset($product['labels']) && is_array($product['labels']) && isset($product['labels']['outofstock']) ? 'outofstock' : ''; ?>">
              <a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button hint--top" data-hint="<?php echo $button_cart; ?>"><i class="button-left-icon"></i><span class="button-cart-text"><?php echo $button_cart; ?></span><i class="button-right-icon"></i></a>
              <a class="read" href="<?php echo $product['href']; ?>">Подробнее</a>
            </div>
            <?php endif; ?>
            
          </div>
        </div>
      </div>
  </div>
  <?php } ?>

Помогите разобраться.. пжл

Link to comment
Share on other sites


13 минут назад, mss сказал:

Подскажите новичку пжл ))

 

Я же Вам подсказал, даже решение нашёл, разжёванное и наглядное.

 

<?php foreach ($products as $key => $product) { ?>

<?php if ($key == 2){ ?>
свой блок
<?php } ?>

<?php } ?>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

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.