Новости Joomla

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

cirip

  • Захожу иногда
  • 112
  • 0 / 0
Всем привет. Есть сайт на JoomShopping 4, и в карточке товара есть цена и кнопка купить. Под фото переместил ЦЕНА и рядом хотелось бы сделать кнопку купить, но при добавления АТРИБУТОВ кнопка КУПИТЬ постоянно прыгает то ниже то выше. Подскажите пожалуйста, как сделать что бы кнопка КУПИТЬ не прыгала, а оставалась на одном месте?



*

Taatshi

  • Глобальный модератор
  • 5258
  • 481 / 2
  • Верстаем и кодим. Обращайтесь ;)
Re: JoomShopping блок на одном весте
« Ответ #1 : 29.03.2021, 23:08:27 »
Переверстывать нужно. Фотку и атрибуты в один блок-обертку, а кнопки во второй под ними.
ВЕРСТКА, САЙТЫ ПОД КЛЮЧ, УДАЛЕНИЕ ВИРУСОВ, МИГРАЦИЯ НА JOOMLA 3, ОБНОВЛЕНИЕ  |  ОТЗЫВЫ 
Связь: telegram - Taatshi, почта - Taatshi на яндексе, Skype - Taatshi
*

cirip

  • Захожу иногда
  • 112
  • 0 / 0
Re: JoomShopping блок на одном весте
« Ответ #2 : 30.03.2021, 00:21:16 »
Переверстывать нужно. Фотку и атрибуты в один блок-обертку, а кнопки во второй под ними.
Спасибо за быстрый ответ. Будем пробовать и изучать PHP
*

cirip

  • Захожу иногда
  • 112
  • 0 / 0
Re: JoomShopping блок на одном весте
« Ответ #3 : 30.03.2021, 00:48:11 »
Переверстывать нужно. Фотку и атрибуты в один блок-обертку, а кнопки во второй под ними.
Помогите если что-то не так делаю. нашёл где находится код блоков, но при перемещение нужно ещё вносить правки CSS что бы блоки хотя бы поставились как на скрине. Возможно через PHP объединить блоки что бы не вносить правки в CSS и выровнить кнопки КУПИТЬ по правую сторону от цены?



Код
<!--блок с ценой-->
            <?php if ($this->product->_display_price){?>
                <div class="prod_price">
                    <!--<span class="prod_price_text"><?php print _JSHOP_PRICE?>:</span>--> <span id="block_price"><?php print formatprice($this->product->getPriceCalculate())?><?php print $this->product->_tmp_var_price_ext;?></span>
                </div><!--блок с ценой-->
                <!--блок с кнопкой купить-->
            <?php print $this->_tmp_product_html_before_buttons;?>
            <div class="clearfix"></div>
            <?php if (!$this->hide_buy){?>
                <div class="prod_buttons" style="<?php print $this->displaybuttons?>">
                    <div class="buttons">
                    <div class="input-append">
                        <button type="submit" class="btn list-btn button buy" value="<?php print _JSHOP_ADD_TO_CART?>" onclick="jQuery('#to').val('cart');"><i class="fa fa-shopping-cart">&nbsp;</i><?php print _JSHOP_ADD_TO_CART?>&nbsp;</button>
                    </div>
                        <?php print $this->_tmp_qty_unit_pre;?>
                        <input type="text" name="quantity" id="quantity" onkeyup="reloadPrices();" class="btn list-btn quantity inputbox" value="<?php print $this->default_count_product?>" /><?php print $this->_tmp_qty_unit_after;?>
                        <?php print $this->_tmp_qty_unit;?>
                        <?php print $this->_tmp_wlist;?>
                        <?php print $this->_tmp_product_html_buttons;?>
                    </div>
                    <div id="jshop_image_loading" style="display:none"></div>
                </div>
            <?php }?>
            <?php print $this->_tmp_product_html_after_buttons;?>
<!--блок с кнопкой купить-->   
*

cirip

  • Захожу иногда
  • 112
  • 0 / 0
Re: JoomShopping блок на одном весте
« Ответ #4 : 30.03.2021, 01:47:47 »
Вроде всё получилось, но только переделал немного php для блоков ЦЕНА и КОРЗИНА. Фото и атрибуты не трогал. Но если сужать браузер то получается какой то перевертыш, ЦЕНА где то с лево от картинки и то есть вся страница товара переворачивается.
Добавил в каждый блок <div class="left_block" class="prod_price"> и <div class="right_block" class="prod_buttons" style="<?php print $this->displaybuttons?>"> + добавил CSS для этих блоков

Код
div.left_block {
    float: left;
    width: 288px;
    display: block;
    text-align: center;
    background-color: #0699A9;
    color: #ffffff;
}
div.right_block {
    float: unset;
    width: 313px;
    margin-left: 315px;
    margin-top: -37px;
}
Знающие люди, посмотрите пожалуйста весь код PHP, и подскажите может быть я что то неправильно сделал.
Код
<?php defined('_JEXEC') or die('Restricted access');?>
<form name="product" method="post" action="<?php print $this->action?>" enctype="multipart/form-data" autocomplete="off">
    <?php print $this->_tmp_product_html_start;?>
    <div class="row<?php print $row_postfix?> jshop pm1">
        <div class="<?php print $prefix.$pibw;?> image_middle">
            <?php print $this->_tmp_product_html_before_image;?>
            <?php if ($product->label_id){?>
                <div class="product_label">
                    <?php if ($product->_label_image){?>
                        <img src="<?php print $product->_label_image?>" alt="<?php print htmlspecialchars($product->_label_name)?>" />
                    <?php }else{?>
                        <span class="label_name"><?php print $product->_label_name;?></span>
                    <?php }?>
                </div>
            <?php }?>
            <?php if (count($this->videos)){?>
                <?php foreach($this->videos as $k=>$video){?>
                    <?php if ($video->video_code){ ?>
                    <div style="display:none" class="video_full" id="hide_video_<?php print $k?>"><?php echo $video->video_code?></div>
                    <?php } else { ?>
                    <a style="display:none" class="video_full" id="hide_video_<?php print $k?>" href=""></a>
                    <?php } ?>
                <?php } ?>
            <?php }?>

            <span id='list_product_image_middle'>
            <?php print $this->_tmp_product_html_body_image?>
            <?php if(!count($this->images)){?>
                <img id = "main_image" src = "<?php print $this->image_product_path?>/<?php print $this->noimage?>" alt = "<?php print htmlspecialchars($this->product->name)?>" />
            <?php }?>
            <?php foreach($this->images as $k=>$image){?>
            <a class="lightbox" id="main_image_full_<?php print $image->image_id?>" href="<?php print $this->image_product_path?>/<?php print $image->image_full;?>" <?php if ($k!=0){?>style="display:none"<?php }?> title="<?php print htmlspecialchars($image->_title)?>">
                <img id = "main_image_<?php print $image->image_id?>" class="main_image" src = "<?php print $this->image_product_path?>/<?php print $image->image_name;?>" alt="<?php print htmlspecialchars($image->_title)?>" title="<?php print htmlspecialchars($image->_title)?>" />
                <div class="text_zoom">
                    <img src="<?php print $this->path_to_image?>search.png" alt="zoom" /> <?php print _JSHOP_ZOOM_IMAGE?>
                </div>
            </a>
            <?php }?>
            </span>
<!--Блок с ценой в товаре-->
            <?php if ($this->product->_display_price){?>
                <div class="left_block" class="prod_price">
                    <!--<span class="prod_price_text"><?php print _JSHOP_PRICE?>:</span>--> <span id="block_price"><?php print formatprice($this->product->getPriceCalculate())?><?php print $this->product->_tmp_var_price_ext;?></span>
                </div>
            <?php }?>
            <?php print $this->product->_tmp_var_bottom_price;?>
<!--Блок с ценой в товаре-->
<!--Блок с кнопкой купить в товаре-->
            <?php print $this->_tmp_product_html_before_buttons;?>
            <div class="clearfix"></div>
            <?php if (!$this->hide_buy){?>
                <div class="right_block"  class="prod_buttons" style="<?php print $this->displaybuttons?>">
                    <div class="buttons">
                    <div class="input-append">
                        <button type="submit" class="btn list-btn button buy" value="<?php print _JSHOP_ADD_TO_CART?>" onclick="jQuery('#to').val('cart');"><i class="fa fa-shopping-cart">&nbsp;</i><?php print _JSHOP_ADD_TO_CART?>&nbsp;</button>
                    </div>
                        <?php print $this->_tmp_qty_unit_pre;?>
                        <input type="text" name="quantity" id="quantity" onkeyup="reloadPrices();" class="btn list-btn quantity inputbox" value="<?php print $this->default_count_product?>" /><?php print $this->_tmp_qty_unit_after;?>
                        <?php print $this->_tmp_qty_unit;?>
                        <?php print $this->_tmp_wlist;?>
                        <?php print $this->_tmp_product_html_buttons;?>
                    </div>
                    <div id="jshop_image_loading" style="display:none"></div>
                </div>
            <?php }?>
<!--Блок с кнопкой купить в товаре-->
            <?php if ($this->product->product_old_price > 0){?>
                <div class="old_price">
                    <?php // print _JSHOP_OLD_PRICE?> <span class="old_price" id="old_price"><?php print formatprice($this->product->product_old_price)?><?php print $this->product->_tmp_var_old_price_ext;?></span>
                </div>
                <div class="clearfix"></div>
            <?php }?>
            <?php print $this->_tmp_product_html_after_image;?>

            <div class = "jshop_img_description">
                <?php print $this->_tmp_product_html_before_image_thumb;?>
                <span id='list_product_image_thumb'>
                <?php if ( (count($this->images)>1) || (count($this->videos) && count($this->images)) ) {?>
                    <?php foreach($this->images as $k=>$image){?>
                        <img class="jshop_img_thumb" src="<?php print $this->image_product_path?>/<?php print $image->image_thumb?>" alt="<?php print htmlspecialchars($image->_title)?>" title="<?php print htmlspecialchars($image->_title)?>" onclick="showImage(<?php print $image->image_id?>)" />
                    <?php }?>
                <?php }?>
                </span>
                <?php print $this->_tmp_product_html_after_image_thumb;?>
                <?php if (count($this->videos)){?>
                    <?php foreach($this->videos as $k=>$video){?>
                        <?php if ($video->video_code) { ?>
                        <a href="#" id="video_<?php print $k?>" onclick="showVideoCode(this.id);return false;"><img class="jshop_video_thumb" src="<?php print $this->video_image_preview_path."/"; if ($video->video_preview) print $video->video_preview; else print 'video.gif'?>" alt="video" /></a>
                        <?php } else { ?>
                        <a href="<?php print $this->video_product_path?>/<?php print $video->video_name?>" id="video_<?php print $k?>" onclick="showVideo(this.id, '<?php print $this->config->video_product_width;?>', '<?php print $this->config->video_product_height;?>'); return false;"><img class="jshop_video_thumb" src="<?php print $this->video_image_preview_path."/"; if ($video->video_preview) print $video->video_preview; else print 'video.gif'?>" alt="video" /></a>
                        <?php } ?>
                    <?php } ?>
                <?php }?>
                <?php print $this->_tmp_product_html_after_video;?>
            </div>
       
            <?php print $this->_tmp_product_html_before_demofiles; ?>
            <div id="list_product_demofiles"><?php include(dirname(__FILE__)."/demofiles.php");?></div>
            <?php print $this->_tmp_product_html_after_demofiles; ?>
            <?php if ($on_mod_inproducts && !in_array($this->product->product_id, $prod_mod_exclude_arr) && !in_array($this->category_id, $categ_mod_exclude_arr)) { print '<div class="dopmod_inproducts">'.$dopmod_inproducts.'</div>'; } ?>
        </div>
        <!--END SPAN IMAGE (LEFT)-->
       
        <!--PRODUCT CAPTION (SECOND BLOCK)-->
        <div class="<?php print $prefix.$ptbw;?> product_caption">
            <?php include(dirname(__FILE__)."/ratingandhits.php");?>
            <h1><?php print $this->product->name?></h1>
           
            <?php if ($this->config->show_product_code && $this->product->getEan()){?> <span class="jshop_code_prod"><?php print _JSHOP_EAN?>: <span id="product_code"><?php print $this->product->getEan();?></span></span><?php }?><?php if ($this->config->show_product_code && $this->product->getEan() && $this->config->manufacturer_code_in_product_detail && $this->product->getManufacturerCode()) print ",";?>
           
            <?php if ($this->config->manufacturer_code_in_product_detail && $this->product->getManufacturerCode()){?> <span class="jshop_manufacturer_prod"><?php print _JSHOP_MANUFACTURER_CODE?>: <span id="manufacturer_code"><?php print $this->product->getManufacturerCode();?></span></span><?php }?>
            <?php if ($on_list_categories=="1") include(dirname(__FILE__)."/_list_categories.php"); ?>
            <hr />

            <?php if ($ssdp) {?>
                <div class="pfm_short_description">
                    <?php print $this->product->short_description;?>
                </div>
                <?php if ($this->product->short_description) {?>
                    <hr/>
                <?php } ?>
            <?php }?>

            <?php if ($this->config->product_show_manufacturer && $this->product->manufacturer_info->name!=""){?>
                <div class="manufacturer_name mf_id_<?php print $this->product->manufacturer_info->id ?>">
                    <?php print _JSHOP_MANUFACTURER?>: <span><?php print $this->product->manufacturer_info->name?></span>
                </div>
            <?php }?>
            <?php if ($this->config->product_show_manufacturer_logo && $this->product->manufacturer_info->manufacturer_logo!=""){?>
                <div class="manufacturer_logo mf_id_<?php print $this->product->manufacturer_info->id ?>">
                    <a href="<?php print SEFLink('index.php?option=com_jshopping&controller=manufacturer&task=view&manufacturer_id='.$this->product->product_manufacturer_id, 2);?>">
                        <img src="<?php print $this->config->image_manufs_live_path."/".$this->product->manufacturer_info->manufacturer_logo?>" alt="<?php print htmlspecialchars($this->product->manufacturer_info->name);?>" title="<?php print htmlspecialchars($this->product->manufacturer_info->name);?>" border="0" />
                    </a>
                </div>
            <?php }?>
       
            <?php if ($this->product->vendor_info){?>
                <div class="vendorinfo vendor_id_<?php print $this->product->vendor_info->id ?>">
                    <?php print _JSHOP_VENDOR?>: <span><?php print $this->product->vendor_info->shop_name?> <?php print $this->product->vendor_info->l_name." ".$this->product->vendor_info->f_name;?></span>
                    <?php if ($this->config->product_show_vendor_detail){?>
                        <a rel="tooltip" data-placement="top" data-original-title="<?php print _JSHOP_ABOUT_VENDOR?>" href="<?php print $this->product->vendor_info->urlinfo?>"><?php print $this->_tmp_vendor_icon;?></a>
                    <?php }?>
                    <a rel="tooltip" data-placement="top" data-original-title="<?php print _JSHOP_VIEW_OTHER_VENDOR_PRODUCTS?>" href="<?php print $this->product->vendor_info->urllistproducts?>"><?php print $this->_tmp_vendor_icon_products;?></a>
                </div>
            <?php }?>
       
            <?php if (($this->config->product_show_manufacturer && $this->product->manufacturer_info->name!="") || $this->product->vendor_info) {print "<hr/>";} ?>
       
            <!--EXTRA FIELDS-->
            <?php if ($show_tabs_ef!="1" || $on_tabs!="1"){
                include(dirname(__FILE__)."/_extrafield_".$templ_type.".php");
            }?>
            <!--END EXTRA FIELDS-->
           
            <!--ATTRIBUTES-->
            <?php include(dirname(__FILE__)."/_attributes.php");?>
            <?php if (count($this->attributes) || count($this->product->freeattributes)) //{print "<hr/>";}?>
            <!--END ATTRIBUTES-->

           
            <?php if ($this->config->show_tax_in_product && $this->product->product_tax > 0){?>
                <span class="taxinfo"><?php print productTaxInfo($this->product->product_tax);?>;</span>
            <?php }?>
            <?php if ($this->config->show_plus_shipping_in_product){?>
                <span class="plusshippinginfo"><?php print sprintf(_JSHOP_PLUS_SHIPPING, $this->shippinginfo);?></span>
            <?php }?>
            <div class="clearfix"></div>
   
            <div class="product-full-caption">
                <?php if ($this->product->product_is_add_price){?>
                <div class="price_prod_qty_list_head"><?php print _JSHOP_PRICE_FOR_QTY?></div>
                    <table class="table price_prod_qty_list">
                    <?php foreach($this->product->product_add_prices as $k=>$add_price){?>
                        <tr>
                            <td class="qty_from" <?php if ($add_price->product_quantity_finish==0){?>colspan="3"<?php } ?>>
                                <?php if ($add_price->product_quantity_finish==0) print _JSHOP_FROM?>
                                <?php print $add_price->product_quantity_start?> <?php print $this->product->product_add_price_unit?>
                            </td>
                            <?php if ($add_price->product_quantity_finish > 0){?>
                            <td class="qty_line"> - </td>
                            <?php } ?>
                            <?php if ($add_price->product_quantity_finish > 0){?>
                            <td class="qty_to">
                                <?php print $add_price->product_quantity_finish?> <?php print $this->product->product_add_price_unit?>
                            </td>
                            <?php } ?>
                            <td class="qty_price">           
                                <span id="pricelist_from_<?php print $add_price->product_quantity_start?>"><?php print formatprice($add_price->price)?><?php print $add_price->ext_price?></span> <span class="per_piece">/ <?php print $this->product->product_add_price_unit?></span>
                            </td>
                        </tr>
                    <?php }?>
                    </table>
                <?php }?>
               
                <?php if ($this->product->product_price_default > 0 && $this->config->product_list_show_price_default){?>
                    <div class="default_price"><?php print _JSHOP_DEFAULT_PRICE?>: <span id="pricedefault"><?php print formatprice($this->product->product_price_default)?></span></div>
                <?php }?>       
               
                <?php if ($this->product->product_basic_price_show){?>
                    <div class="prod_base_price"><?php print _JSHOP_BASIC_PRICE?>: <span id="block_basic_price"><?php print formatprice($this->product->product_basic_price_calculate)?></span> / <?php print $this->product->product_basic_price_unit_name;?></div>
                <?php }?>
                <?php if ($this->config->product_show_weight && $this->product->product_weight > 0){?>
                    <div class="productweight"><?php print _JSHOP_WEIGHT?>: <span id="block_weight"><?php print formatweight($this->product->getWeight())?></span></div>
                <?php }?>
           
                <?php if ($this->config->product_show_qty_stock){?>
                    <div class="qty_in_stock"><?php print _JSHOP_QTY_IN_STOCK?>: <span id="product_qty"><?php print sprintQtyInStock($this->product->qty_in_stock);?></span></div>
                <?php }?>
               
                <?php if ($this->product->delivery_time != ''){?>
                    <div class="deliverytime" <?php if ($product->hide_delivery_time){?>style="display:none"<?php }?>><?php print _JSHOP_DELIVERY_TIME?>: <span><?php print $this->product->delivery_time?></span></div>
                <?php }?>
            </div>
            <?php print $this->_tmp_product_html_after_buttons;?>
   
            <?php if (!$this->config->hide_text_product_not_available){ ?>
                <div class = "not_available" id="not_available"><?php print $this->available?></div>
            <?php }?>
        </div>
        <!--END PRODUCT CAPTION (SECOND BLOCK)-->
       
        <!--THIRD BLOCK-->
        <?php if ($ppbw!="0" || $doptext_inproducts!="") {?>
            <div class="<?php print $prefix.$ppbw;?> third_extblock">
                <?php print $thirdblock_text; ?>
                <?php if ($on_mod_inproducts) { print $doptext_inproducts;} ?>
            </div>
        <?php }?>
        <!--END THIRD BLOCK-->

    </div>

    <input type="hidden" name="to" id='to' value="cart" />
    <input type="hidden" name="product_id" id="product_id" value="<?php print $this->product->product_id?>" />
    <input type="hidden" name="category_id" id="category_id" value="<?php print $this->category_id?>" />
</form>
Прикрепляю оригинальный файл PHP. https://disk.yandex.ru/d/G9_vcqUobOIWnw
« Последнее редактирование: 30.03.2021, 01:51:24 от cirip »
*

Taatshi

  • Глобальный модератор
  • 5258
  • 481 / 2
  • Верстаем и кодим. Обращайтесь ;)
Re: JoomShopping блок на одном весте
« Ответ #5 : 30.03.2021, 07:35:00 »
По коду такие вещи сложно советовать, на страницу бы посмотреть... Мы-то всех стилей не знаем. И, даже если прикрепить все, невозможно чисто по коду угадать как все это отобразится. Есть возможность показать?
ВЕРСТКА, САЙТЫ ПОД КЛЮЧ, УДАЛЕНИЕ ВИРУСОВ, МИГРАЦИЯ НА JOOMLA 3, ОБНОВЛЕНИЕ  |  ОТЗЫВЫ 
Связь: telegram - Taatshi, почта - Taatshi на яндексе, Skype - Taatshi
*

sivers

  • Живу я здесь
  • 2465
  • 336 / 0
Re: JoomShopping блок на одном весте
« Ответ #6 : 30.03.2021, 10:08:05 »
А не проще ли было в изначальном варианте зафиксировать высоту (или минимальную высоту) блока атрибутов? Тогда кнопка под блоком всегда оставалась бы на одном уровне.
Но в любом из вариантов надо решить что делать, если атрибутов будет больше, чем пространство до кнопки купить. или она уползет вниз, или перекроет атрибуты (либо в блок атрибутов добавится прокрутка).
На связи в telegram @sivers
sivers @ inbox . ru
https://sivers.su/
*

cirip

  • Захожу иногда
  • 112
  • 0 / 0
Re: JoomShopping блок на одном весте
« Ответ #7 : 30.03.2021, 11:13:32 »
По коду такие вещи сложно советовать, на страницу бы посмотреть... Мы-то всех стилей не знаем. И, даже если прикрепить все, невозможно чисто по коду угадать как все это отобразится. Есть возможность показать?
Сайт mastermonument.ru
*

Taatshi

  • Глобальный модератор
  • 5258
  • 481 / 2
  • Верстаем и кодим. Обращайтесь ;)
Re: JoomShopping блок на одном весте
« Ответ #8 : 30.03.2021, 12:11:14 »
Так, как есть мы видим. Осталось узнать как хочется чтобы было)
ВЕРСТКА, САЙТЫ ПОД КЛЮЧ, УДАЛЕНИЕ ВИРУСОВ, МИГРАЦИЯ НА JOOMLA 3, ОБНОВЛЕНИЕ  |  ОТЗЫВЫ 
Связь: telegram - Taatshi, почта - Taatshi на яндексе, Skype - Taatshi
*

cirip

  • Захожу иногда
  • 112
  • 0 / 0
Re: JoomShopping блок на одном весте
« Ответ #9 : 30.03.2021, 12:17:11 »
Так, как есть мы видим. Осталось узнать как хочется чтобы было)
При уменьшение браузера у меня всё переворачивается, а хотелось бы что бы всё зафиксировалось как положено (сверху вниз, а не что бы цена была с лево рядом с картинкой). То есть что бы всё смотрелось красиво если бы код не переделывал.
1) Название товара
2) Картинка вверху и после неё шли остальные блоки
3) Цена
4) Кнопки купить и т.д.


Открыл страницу через другой браузер и на сайте вообще всё не так как в другом браузере.
« Последнее редактирование: 30.03.2021, 12:20:29 от cirip »
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться