Новости Joomla

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

Fedor Vlasenko

  • Живу я здесь
  • 3845
  • 733 / 7
  • https://fedor-vlasenko.web.app
Буду благодарен за любую помощь. Задача вывести изображение атрибута в корзине товара версии 3.5.1
Сам спросил сам ответил. Код для cart.php
Код: php
<?php 
$_attributevalue = &JTable::getInstance('AttributValue', 'jshop');
$all_attr_values = $_attributevalue->getAllAttributeValues();
$jshopConfig = &JSFactory::getConfig();
$path = $jshopConfig->image_attributes_live_path;
$urlimg = $path."/".$all_attr_values[30]->image;
echo "<img src='".$urlimg."' alt='".$all_attr_values[30]->name."' />";
print_r($all_attr_values); //смотрим массив с атрибутами
?>
*

nevigen

  • Moderator
  • 10436
  • 863 / 25
  • http://n*****n.com
Отлично !
Добавил в FAQ.
Профессиональные / Бесплатные решения для JoomShopping
Не лечи бесплатно, ибо тот, кто лечится бесплатно, рано или поздно перестает ценить свое здоровье,
а тот, кто лечит бесплатно, рано или поздно перестает ценить результаты своего труда/ (с) Гиппократ?
Не ищите ответов, ищите решение !
*

Ramil8009

  • Захожу иногда
  • 147
  • 1 / 1
В версиях постарше вот эта строчка:
Код
$urlimg = $path."/".$all_attr_values[30]->image;
выводит только путь до папки, из-за этого картинка отсутсутвует.
Как модифицировать код, чтоб работала в новых версиях. У меня версия магазина 3.11.1
*

Ramil8009

  • Захожу иногда
  • 147
  • 1 / 1
все что выводит ваш код вместо атрибута товара - это вот такую штуку:
Код
Array ( [0] => stdClass Object ( [value_id] => 1 [image] => [name] => Красный [attr_id] => 1 [value_ordering] => 1 ) [1] => stdClass Object ( [value_id] => 2 [image] => 3.jpg [name] => Черный [attr_id] => 1 [value_ordering] => 2 ) [2] => stdClass Object ( [value_id] => 3 [image] => 1.jpg [name] => Зеленый [attr_id] => 1 [value_ordering] => 3 ) [3] => stdClass Object ( [value_id] => 4 [image] => 4.jpg [name] => Темно-синий [attr_id] => 1 [value_ordering] => 4 ) ) 
« Последнее редактирование: 25.12.2012, 21:11:40 от Ramil8009 »
*

Fedor Vlasenko

  • Живу я здесь
  • 3845
  • 733 / 7
  • https://fedor-vlasenko.web.app
*

Ramil8009

  • Захожу иногда
  • 147
  • 1 / 1
Ну как ^-^ мне нужно вывести картинку того атрибута, который выбрал покупатель. Я ж незнаю какой он выберет, а статичный путь можно и руками написать.
« Последнее редактирование: 25.12.2012, 23:02:14 от Ramil8009 »
*

Ramil8009

  • Захожу иногда
  • 147
  • 1 / 1
Было бы идеально вместо вот этого:
Код
echo $all_attr_values[3]->image; //4.jpg
просто выводить ID нужного атрибута и добавлять расширение картинки, Jpg например у меня, ведь название картинки атрибута совпадает с его Id
только как это сделать не могу понять
« Последнее редактирование: 25.12.2012, 23:02:48 от Ramil8009 »
*

Fedor Vlasenko

  • Живу я здесь
  • 3845
  • 733 / 7
  • https://fedor-vlasenko.web.app
нет магазина под рукой глянь как там цена или сумм выводится, посмотри если там данные нужные тебе
к примеру
<?php var_dump($cart); ?>
*

Ramil8009

  • Захожу иногда
  • 147
  • 1 / 1
В cart.php ?
Код
<?php $countprod = count($this->products);?>
<div class="jshop">
<form action="<?php print SEFLink('index.php?option=com_jshopping&controller=cart&task=refresh')?>" method="post" name="updateCart">
<?php print $this->_tmp_ext_html_cart_start?>
<?php if ($countprod>0){?>
<table class="jshop cart">
  <tr>
    <th width="20%">
      <?php print _JSHOP_IMAGE?>
    </th>
    <th>
      <?php print _JSHOP_ITEM?>
    </th>   
    <th width="15%">
      <?php print _JSHOP_SINGLEPRICE?>
    </th>
    <th width="15%">
      <?php print _JSHOP_NUMBER?>
    </th>
    <th width="15%">
      <?php print _JSHOP_PRICE_TOTAL?>
    </th>
    <th width="10%">
      <?php print _JSHOP_REMOVE?>
    </th>
  </tr>
  <?php
  $i=1;   
  foreach($this->products as $key_id=>$prod){
  ?>
  <tr class="jshop_prod_cart <?php if ($i%2==0) print "even"; else print "odd"?>">
    <td class="jshop_img_description_center">
      <a href="<?php print $prod['href']?>">
        <img src="<?php print $this->image_product_path ?>/<?php if ($prod['thumb_image']) print $prod['thumb_image']; else print $this->no_image; ?>" alt="<?php print htmlspecialchars($prod['product_name']);?>" class="jshop_img" />
      </a>
    </td>
    <td class="product_name">
        <a href="<?php print $prod['href']?>"><?php print $prod['product_name']?></a>
        <?php if ($this->config->show_product_code_in_cart){?>
        <span class="jshop_code_prod">(<?php print $prod['ean']?>)</span>
        <?php }?>
        <?php if ($prod['manufacturer']!=''){?>
        <div class="manufacturer"><?php print _JSHOP_MANUFACTURER?>: <span><?php print $prod['manufacturer']?></span></div>
        <?php }?>
        <?php print sprintAtributeInCart($prod['attributes_value']);?>
        <?php print sprintFreeAtributeInCart($prod['free_attributes_value']);?>
        <?php print sprintFreeExtraFiledsInCart($prod['extra_fields']);?>
        <?php print $prod['_ext_attribute_html']?>
    </td>
    <td>
        <?php print formatprice($prod['price'])?>
        <?php print $prod['_ext_price_html']?>
        <?php if ($this->config->show_tax_product_in_cart && $prod['tax']>0){?>
            <span class="taxinfo"><?php print productTaxInfo($prod['tax']);?></span>
        <?php }?>
    </td>
    <td>
      <input type = "text" name = "quantity[<?php print $key_id ?>]" value = "<?php print $prod['quantity'] ?>" class = "inputbox" style = "width: 25px" />
      <?php print $prod['_qty_unit'];?>
      <span class = "cart_reload"><img style="cursor:pointer" src="<?php print $this->image_path ?>/images/reload.png" title="<?php print _JSHOP_UPDATE_CART ?>" alt = "<?php print _JSHOP_UPDATE_CART ?>" onclick="document.updateCart.submit();" /></span>
    </td>
    <td>
        <?php print formatprice($prod['price']*$prod['quantity']); ?>
        <?php print $prod['_ext_price_total_html']?>
        <?php if ($this->config->show_tax_product_in_cart && $prod['tax']>0){?>
            <span class="taxinfo"><?php print productTaxInfo($prod['tax']);?></span>
        <?php }?>
    </td>
    <td>
      <a href="<?php print $prod['href_delete']?>" onclick="return confirm('<?php print _JSHOP_CONFIRM_REMOVE?>')"><img src = "<?php print $this->image_path ?>images/remove.png" alt = "<?php print _JSHOP_DELETE?>" title = "<?php print _JSHOP_DELETE?>" /></a>
    </td>
  </tr>
  <?php
  $i++;
  }
  ?>
</table>
 
  <?php if ($this->config->show_weight_order){?> 
    <div class="weightorder">
        <?php print _JSHOP_WEIGHT_PRODUCTS?>: <span><?php print formatweight($this->weight);?></span>
    </div>
  <?php }?>
 
  <?php if ($this->config->summ_null_shipping>0){?>
    <div class="shippingfree">
        <?php printf(_JSHOP_FROM_PRICE_SHIPPING_FREE, formatprice($this->config->summ_null_shipping, null, 1));?>
    </div>
  <?php } ?>
 
  <br/>
<table class="jshop jshop_subtotal">
  <?php if (!$this->hide_subtotal){?>
  <tr>
    <td class="name">
      <?php print _JSHOP_SUBTOTAL ?>
    </td>
    <td class="value">
      <?php print formatprice($this->summ);?><?php print $this->_tmp_ext_subtotal?>
    </td>
  </tr>
  <?php } ?>
  <?php if ($this->discount > 0){ ?>
  <tr>
    <td class="name">
      <?php print _JSHOP_RABATT_VALUE ?>
    </td>
    <td class="value">
      <?php print formatprice(-$this->discount);?><?php print $this->_tmp_ext_discount?>
    </td>
  </tr>
  <?php } ?>
  <?php if (!$this->config->hide_tax){?>
  <?php foreach($this->tax_list as $percent=>$value){ ?>
  <tr>
    <td class = "name">
      <?php print displayTotalCartTaxName();?>
      <?php if ($this->show_percent_tax) print formattax($percent)."%"?>
    </td>
    <td class = "value">
      <?php print formatprice($value);?><?php print $this->_tmp_ext_tax[$percent]?>
    </td>
  </tr>
  <?php } ?>
  <?php } ?>
  <tr class="total">
    <td class = "name">
      <?php print _JSHOP_PRICE_TOTAL ?>
    </td>
    <td class = "value">
      <?php print formatprice($this->fullsumm)?><?php print $this->_tmp_ext_total?>
    </td>
  </tr>
  <?php if ($this->config->show_plus_shipping_in_product){?> 
  <tr>
    <td colspan="2" align="right">   
        <span class="plusshippinginfo"><?php print sprintf(_JSHOP_PLUS_SHIPPING, $this->shippinginfo);?></span> 
    </td>
  </tr>
  <?php }?>
  <?php if ($this->free_discount > 0){?> 
  <tr>
    <td colspan="2" align="right">   
        <span class="free_discount"><?php print _JSHOP_FREE_DISCOUNT;?>: <?php print formatprice($this->free_discount); ?></span> 
    </td>
  </tr>
  <?php }?> 
</table>
<?php }else{?>
<div class="cart_empty_text"><?php print _JSHOP_CART_EMPTY?></div>
<?php }?>

<table class="jshop" style="margin-top:10px">
  <tr id = "checkout">
    <td width = "50%" class = "td_1">
       <a href = "<?php print $this->href_shop ?>">
         <img src = "<?php print $this->image_path ?>/images/arrow_left.gif" alt="<?php print _JSHOP_BACK_TO_SHOP ?>" />
         <?php print _JSHOP_BACK_TO_SHOP ?>
       </a>
    </td>
    <td width = "50%" class = "td_2">
    <?php if ($countprod>0){?>
       <a href = "<?php print $this->href_checkout ?>">
         <?php print _JSHOP_CHECKOUT ?>
         <img src = "<?php print $this->image_path ?>/images/arrow_right.gif" alt="<?php print _JSHOP_CHECKOUT ?>" />
       </a>
    <?php }?>
    </td>
  </tr>
</table>
</form>

<?php print $this->_tmp_ext_html_before_discount?>
<?php if ($this->use_rabatt && $countprod>0){ ?>
<br /><br />
<form name="rabatt" method="post" action="<?php print SEFLink('index.php?option=com_jshopping&controller=cart&task=discountsave')?>">
<table class="jshop">
  <tr>
    <td>
      <?php print _JSHOP_RABATT ?>
      <input type = "text" class = "inputbox" name = "rabatt" value = "" />
      <input type = "submit" class = "button" value = "<?php print _JSHOP_RABATT_ACTIVE ?>" />
    </td>
  </tr>
</table>
</form>
<?php }?>
</div>


*

Fedor Vlasenko

  • Живу я здесь
  • 3845
  • 733 / 7
  • https://fedor-vlasenko.web.app
Попробуй
foreach($this->products as $key_id=>$prod){
var_dump($prod);//здесь должны быть атрибуты заказанного товара
  ?>
*

Ramil8009

  • Захожу иногда
  • 147
  • 1 / 1
 ;DВыдало вот такую кучу:
Код
array(22) { ["quantity"]=> int(1) ["product_id"]=> int(1) ["category_id"]=> string(1) "1" ["price"]=> float(10000) ["tax"]=> string(5) "19.00" ["tax_id"]=> string(1) "1" ["product_name"]=> string(53) "Кресло парикмахерское A130 MADRID" ["thumb_image"]=> string(42) "thumb_6abd74f40a8ecfee53fe0d99a24e64d4.jpg" ["delivery_times_id"]=> string(1) "0" ["ean"]=> string(0) "" ["attributes"]=> string(14) "a:1:{i:1;i:3;}" ["attributes_value"]=> array(1) { [0]=> object(stdClass)#431 (2) { ["attr"]=> string(21) "цвет обивки" ["value"]=> string(14) "Зеленый" } } ["extra_fields"]=> array(0) { } ["weight"]=> string(6) "0.0000" ["vendor_id"]=> string(1) "1" ["files"]=> string(6) "a:0:{}" ["freeattributes"]=> string(6) "a:0:{}" ["pid_check_qty_value"]=> string(3) "P:1" ["href"]=> string(51) "/component/jshopping/product/view/1/1.html?Itemid=0" ["href_delete"]=> string(32) "/korzina/delete.html?number_id=0" ["free_attributes_value"]=> array(0) { } ["_qty_unit"]=> string(433) "  " } array(22) { ["quantity"]=> int(1) ["product_id"]=> int(10) ["category_id"]=> string(1) "1" ["price"]=> float(11000) ["tax"]=> string(5) "19.00" ["tax_id"]=> string(1) "1" ["product_name"]=> string(53) "Кресло парикмахерское A130 MADRID" ["thumb_image"]=> string(33) "thumb_691496.2qgxajhueg.W3302.jpg" ["delivery_times_id"]=> string(1) "0" ["ean"]=> string(0) "" ["attributes"]=> string(14) "a:1:{i:1;i:3;}" ["attributes_value"]=> array(1) { [0]=> object(stdClass)#430 (2) { ["attr"]=> string(21) "цвет обивки" ["value"]=> string(14) "Зеленый" } } ["extra_fields"]=> array(0) { } ["weight"]=> string(6) "0.0000" ["vendor_id"]=> string(1) "1" ["files"]=> string(6) "a:0:{}" ["freeattributes"]=> string(6) "a:0:{}" ["pid_check_qty_value"]=> string(4) "P:10" ["href"]=> string(52) "/component/jshopping/product/view/1/10.html?Itemid=0" ["href_delete"]=> string(32) "/korzina/delete.html?number_id=1" ["free_attributes_value"]=> array(0) { } ["_qty_unit"]=> string(433) "  " } array(22) { ["quantity"]=> int(1) ["product_id"]=> int(11) ["category_id"]=> string(1) "1" ["price"]=> float(11900) ["tax"]=> string(5) "19.00" ["tax_id"]=> string(1) "1" ["product_name"]=> string(53) "Кресло парикмахерское A130 MADRID" ["thumb_image"]=> string(32) "thumb_691567.feilb05qx1.W330.jpg" ["delivery_times_id"]=> string(1) "0" ["ean"]=> string(0) "" ["attributes"]=> string(14) "a:1:{i:1;i:2;}" ["attributes_value"]=> array(1) { [0]=> object(stdClass)#429 (2) { ["attr"]=> string(21) "цвет обивки" ["value"]=> string(12) "Черный" } } ["extra_fields"]=> array(0) { } ["weight"]=> string(6) "0.0000" ["vendor_id"]=> string(1) "1" ["files"]=> string(6) "a:0:{}" ["freeattributes"]=> string(6) "a:0:{}" ["pid_check_qty_value"]=> string(4) "P:11" ["href"]=> string(52) "/component/jshopping/product/view/1/11.html?Itemid=0" ["href_delete"]=> string(32) "/korzina/delete.html?number_id=2" ["free_attributes_value"]=> array(0) { } ["_qty_unit"]=> string(433) "  " }
*

Fedor Vlasenko

  • Живу я здесь
  • 3845
  • 733 / 7
  • https://fedor-vlasenko.web.app
foreach($this->products as $key_id=>$prod){
echo $prod["attributes_value"][2]["attr"].' - '. $prod["attributes_value"][2]["value"];
  ?>
*

Ramil8009

  • Захожу иногда
  • 147
  • 1 / 1
Выводит: - - -

Ладно раз не выходит, не буду отбирать время, попробую обойтись без картинок в корзине.
Спасибо за помощь!
*

Fedor Vlasenko

  • Живу я здесь
  • 3845
  • 733 / 7
  • https://fedor-vlasenko.web.app
Посмотри я может ошибся немножко
var_dump( $prod["attributes_value"]); и так далее по ступенькам
*

thezet

  • Новичок
  • 3
  • 0 / 0
Народ, а не подскажете как убрать двоеточие в атрибутах в корзине между name и value?
*

nevigen

  • Moderator
  • 10436
  • 863 / 25
  • http://n*****n.com
смотреть FAQ, перечень файлов шаблона...
а там думаю логика подскажет
Профессиональные / Бесплатные решения для JoomShopping
Не лечи бесплатно, ибо тот, кто лечится бесплатно, рано или поздно перестает ценить свое здоровье,
а тот, кто лечит бесплатно, рано или поздно перестает ценить результаты своего труда/ (с) Гиппократ?
Не ищите ответов, ищите решение !
*

staskmp

  • Захожу иногда
  • 50
  • 2 / 0
тоже не работает, выводит кучу текста((
*

Дмитрий_76

  • Захожу иногда
  • 137
  • 24 / 0
Для JoomShopping 4.10.1 никто не подскажет решения по данной теме?
А то тема в FAGe лежит, а уже совсем неактуальная, увы :-(
*

xxx87

  • Захожу иногда
  • 130
  • 4 / 0
  • прошу любить и жаловать
Для JoomShopping 4.10.1 никто не подскажет решения по данной теме?
А то тема в FAGe лежит, а уже совсем неактуальная, увы :-(
Если вопрос актуален - то решается с помощью атрибутов ) Атрибуты должны быть зависимые! Затем загружаешь фото для них в Товар - Атрибут - Дополнительное значение ( крайняя слева кнопка )
Таким образом все работает ))) ура
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Вывести определённую характеристику отдельно от списка характеристик товара

Автор Silent_Breeze

Ответов: 52
Просмотров: 9885
Последний ответ 23.11.2023, 12:31:08
от YuryNew
Как добавить 2 налога на один товар + отображение 2-х налогов в корзине?

Автор tigra-uki

Ответов: 3
Просмотров: 904
Последний ответ 05.05.2023, 13:03:22
от kit2m2
Получить и вывести Статус заказов списком

Автор IgorGeneralov

Ответов: 5
Просмотров: 1218
Последний ответ 25.01.2023, 23:04:05
от IgorGeneralov
Вывод названия атрибута за место Выберите

Автор djwolf

Ответов: 9
Просмотров: 1905
Последний ответ 14.01.2022, 23:06:27
от Akeksandr
Отображение Атрибута в категориях (Решено)

Автор darkghost

Ответов: 1
Просмотров: 1308
Последний ответ 01.10.2021, 17:30:36
от darkghost