Woocommerce Cross Sells - težave pri kodi
1 naročnik
1 naročnik
Zdravo,
Prosil bi za pomoč pri Cross Sells produktih.
V fajlu cross-sells.php najdemo spodnjo kodo:
<?php
/**
* Cross-sells
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $product, $woocommerceloop;
$crosssells = WC()->cart->getcrosssells();
if ( sizeof( $crosssells ) == 0 ) return;
$metaquery = WC()->query->getmetaquery();
$args = array(
'posttype' => 'product',
'ignorestickyposts' => 1,
'nofoundrows' => 1,
'postsperpage' => applyfilters( 'woocommercecrosssellstotal', $postsperpage ),
'orderby' => $orderby,
'postin' => $crosssells,
'metaquery' => $metaquery
);
$products = new WPQuery( $args );
$woocommerceloop['columns'] = applyfilters( 'woocommercecrosssellscolumns', $columns );
if ( $products->haveposts() ) : ?>
<div class="cross-sells">
<?php woocommerceproductloopstart(); ?>
<?php while ( $products->haveposts() ) : $products->thepost(); ?>
<?php wcgettemplatepart( 'content', 'product' ); ?>
<?php endwhile; // end of the loop. ?>
<?php woocommerceproductloopend(); ?>
</div>
<?php endif;
wpreset_query();
?>
ki zgenerira html:
<div class="cross-sells">
<ul class="products">
<li class="post-245 product type-product status-publish has-post-thumbnail first shipping-taxable purchasable product-type-simple instock">
<a href="http://192.168.1.4/php/migration/product/product1/">
<img width="112" height="112" alt="" class="attachment-shop_catalog wp-post-image" src="http://192.168.1.4/php/migration/wp-content/uploads/2014/11/product1.jpg">
<h3>Product1</h3>
<span class="price"><span class="amount">9,99€</span></span>
</a>
<a class="button add_to_cart_button product_type_simple" data-quantity="1" data-product_sku="3" data-product_id="245" rel="nofollow" href="/php/migration/?add-to-cart=245">V košarico</a>
</li>
</ul>
</div>
jaz pa bi rad tako strukturo v html-ju:
<div class="crossSellBox">
<div class="row">
<div class="col-lg-2">
thumbnail
</div>
<div class="col-lg-4">
product name
</div>
<div class="col-lg-3">
Price
</div>
<div class="col-lg-3">
button
</div>
</div>
</div>
**Mi lahko kdo svetuje kako lahko to naredim.? Rad bi, da bi v vsaki koloni lahko poklical npr. printf( '%s', $thumbnail ); nekako tako, kot je to narejeno v cart.php fajlu.
Hvala za vsako pomoč.
LP**