• Hello there.
    I am quite new to woocommerce and i am using for a purpose of non sale. I just want to view my products to clients but not selling them through my website. However I have this code below which Is in the page template. Could anyone let me know what i should change to view each category in a single page? I only have two categories. One is called Imported and other one is called Private Label. Each one of these has three sub categories which i want them to be on top of the page as options.
    Please have a look at this page before answering http://www.sypal.com.cy/products/sypal. This is the page that i want to separate.

    Thank you in advance!

    Elena

    <?php
    /*
    Template Name: Products In List
    */
    get_header();
    ?>

    <section class=”TitleSection”>
    <div class=”container”>
    <div class=”row”>
    <div class=”col-lg-12 col-md-12 text-center”>
    ΠΡΟΪΟΝΤΑ
    </div>
    </div>
    </div>
    </section>

    <section class=”ProductSection”>
    <div class=”container”>
    <div class=”row”>
    <div class=”col-lg-12 col-md-12 text-center”>
    <?php
    $taxonomy = ‘product_cat’;
    $orderby = ‘name’;
    $show_count = 0; // 1 for yes, 0 for no
    $pad_counts = 0; // 1 for yes, 0 for no
    $hierarchical = 1; // 1 for yes, 0 for no
    $title = ”;
    $empty = 0;

    $args = array(
    ‘taxonomy’ => $taxonomy,
    ‘child_of’ => 0,
    ‘parent’ => ‘0’,
    ‘orderby’ => $orderby,
    ‘show_count’ => $show_count,
    ‘pad_counts’ => $pad_counts,
    ‘hierarchical’ => $hierarchical,
    ‘title_li’ => $title,
    ‘hide_empty’ => $empty
    );
    $AllProductCategories = get_categories( $args );
    ?>

    <div class=”product_category button-group filters-button-group”>
    <button class=”button product_cat_name parentCate is-checked” data-filter=”all”>All</button>
    <?php
    foreach ($AllProductCategories as $CategoryData) {
    $parentCat = $CategoryData->term_id;
    ?>
    <button class=”button product_cat_name parentCate” data-value=”<?=$CategoryData->slug;?>” data-filter=”.<?=$CategoryData->slug;?>”><?php echo $CategoryData->name; ?></button>
    <?php
    }
    ?>
    </div>

    </div>
    </div>

    <div class=”row allProductsList”>
    <?php
    $args = array(
    ‘post_type’ => ‘product’,
    ‘posts_per_page’ => -1
    );
    $loop = new WP_Query( $args );
    if ( $loop->have_posts() ) {
    while ( $loop->have_posts() ) {
    $loop->the_post();
    global $post;
    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘single-post-thumbnail’ );
    $class = ”;
    $terms = get_the_terms($post->ID, ‘product_cat’);
    foreach($terms as $termsList) {
    $class .= $termsList->slug.” “;
    }
    ?>
    <div class=”col-lg-12 col-md-12 <?php echo $class; ?> marginBoth”>
    <div class=”row”>
    <div class=”col-lg-3 col-md-3″>
    ” />
    </div>
    <div class=”col-lg-9 col-md-9″>
    <div class=”productTitle”><?php echo $post->post_title; ?></div>
    <div class=”productDescription”><?php echo $post->post_content; ?></div>
    </div>
    </div>
    </div>
    <?php
    }
    }
    else {
    echo __( ‘No products found’ );
    }
    wp_reset_postdata();
    ?>

    </div>
    </div>
    </section>

    <script>
    jQuery(document).ready(function() {
    jQuery(“.button”).click(function() {
    var filterValue = jQuery(this).attr(‘data-filter’);

    if(filterValue == ‘all’) {
    jQuery(“.allProductsList .marginBoth”).show();
    }
    else {
    jQuery(“.allProductsList .marginBoth”).hide();
    jQuery(“.allProductsList “+filterValue).show();
    }

    });
    });

    </script>

    <style type=”text/css”>
    .allProductsList {
    padding:40px 0px;
    }
    .TitleSection {
    padding:250px 0px 70px;
    background-image: url(http://www.sypal.com.cy/wp-content/uploads/2016/11/vector-yellow-abstract-background.jpg?id=2668) !important;
    font-size:40px;
    color: #333;
    }
    .product_inner:hover img {
    opacity: .2;
    -moz-transform: scale(1.06);
    -webkit-transform: scale(1.06);
    -o-transform: scale(1.06);
    -ms-transform: scale(1.06);
    transform: scale(1.06);
    }
    .product_inner {
    overflow:hidden;
    }
    .product_inner img {
    -webkit-transition: all .5s ease;
    transition: all .5s ease;
    width:100%;
    height:300px;
    object-fit:cover;
    }
    .image-caption {
    position: absolute;
    top: 0px;
    background: rgba(16, 117, 187, 0.6);
    width: 100%;
    height: 100%;
    color: #fff;
    text-align: center;
    padding: 140px 0px;
    display: none;
    transition: all .5s ease;
    color: #000;
    font-size: 17px;
    font-weight: 600;
    }
    .ProductSection {
    padding:50px 0px;
    }

    .button, .button.size-large, .button.size-small, .button.size-xl, .button.size-xxl {
    border: 2px solid;
    border-radius: 0;
    font-size: 14px !important;
    transition: all 0.5s ease 0s;
    border-color: #e2e2e2;
    color: #8b8b8b;
    }
    .product_cat_name, .product_cat_name:hover {
    background-color: #fff;
    }
    .marginBoth img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    }
    .productTitle {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    margin-bottom: 20px;
    margin-top: 20px;
    }
    .marginBoth img {
    width: 100%;
    }
    .productDescription {
    text-align: justify;
    }
    .marginBoth {
    padding: 20px 20px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-bottom: 5px;
    }
    </style>
    <?php
    get_footer();
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter aneledesigns

    (@aneledesigns)

    ‘`
    ### WordPress Environment ###

    Home URL: http://www.sypal.com.cy
    Site URL: http://www.sypal.com.cy
    WC Version: 2.6.11
    Log Directory Writable: ✔
    WP Version: 4.7
    WP Multisite: –
    WP Memory Limit: 512 MB
    WP Debug Mode: –
    WP Cron: ✔
    Language: en_US

    ### Server Environment ###

    Server Info: Apache/2
    PHP Version: ❌ 5.5.22 – We recommend a minimum PHP version of 5.6. See: How to update your PHP version
    PHP Post Max Size: 20 MB
    PHP Time Limit: 120
    PHP Max Input Vars: 1000
    cURL Version: 7.22.0
    OpenSSL/1.0.2h

    SUHOSIN Installed: –
    MySQL Version: 5.6.32
    Max Upload Size: 20 MB
    Default Timezone is UTC: ✔
    fsockopen/cURL: ✔
    SoapClient: ❌ Your server does not have the SoapClient class enabled – some gateway plugins which use SOAP may not work as expected.
    DOMDocument: ✔
    GZip: ✔
    Multibyte String: ✔
    Remote Post: ✔
    Remote Get: ✔

    ### Database ###

    WC Database Version: 2.6.11
    :
    woocommerce_sessions: ✔
    woocommerce_api_keys: ✔
    woocommerce_attribute_taxonomies: ✔
    woocommerce_downloadable_product_permissions: ✔
    woocommerce_order_items: ✔
    woocommerce_order_itemmeta: ✔
    woocommerce_tax_rates: ✔
    woocommerce_tax_rate_locations: ✔
    woocommerce_shipping_zones: ✔
    woocommerce_shipping_zone_locations: ✔
    woocommerce_shipping_zone_methods: ✔
    woocommerce_payment_tokens: ✔
    woocommerce_payment_tokenmeta: ✔
    MaxMind GeoIP Database: ❌ The MaxMind GeoIP Database does not exist – Geolocation will not function. You can download and install it manually from http://dev.maxmind.com/geoip/legacy/geolite/ to the path: . Scroll down to \”Downloads\” and download the \”Binary / gzip\” file next to \”GeoLite Country\”

    ### Active Plugins (27) ###

    404 Redirection: by flippingwp.com – 1.8
    LayerSlider WP: by Kreatura Media – 6.0.5
    Ultimate Addons for Visual Composer: by Brainstorm Force – 3.16.7
    Coming Soon by Supsystic: by supsystic.com – 1.3.2
    Contact Form 7: by Takayuki Miyoshi – 4.6
    Disable Comments: by Samir Shah – 1.6
    Facebook Widget: by Milap Patel – 4.1
    Faster Pagination: by FasterThemes – 1.0
    iframe: by webvitaly – 4.3
    WPBakery Visual Composer: by Michael M – WPBakery.com – 5.0
    Login Page Styler: by Zia Imtiaz – 3.1.5
    Members: by Justin Tadlock – 1.1.2
    Photo Gallery: by WebDorado – 1.3.24
    Popup by Supsystic: by supsystic.com – 1.8.4
    Responsive Lightbox: by dFactory – 1.6.10
    Slider Revolution: by ThemePunch – 5.2.6
    SEO Ultimate: by SEO Design Solutions – 7.6.5.9
    Shortcodes Ultimate: by Vladimir Anokhin – 4.9.9
    Simple Pagination: by GeekPress – 2.1.7
    Symple Shortcodes: by AJ Clarke – 2.0.2
    Theme Check: by Otto42
    pross – 20160523.1

    upPrev: by Marcin Pietrzak – 3.3.30
    WP Canvas – Gallery: by Chris Baldelomar – 1.53
    Widget Importer & Exporter: by churchthemes.com – 1.3.2
    WooCommerce: by WooThemes – 2.6.11
    WP Retina 2x: by Jordy Meow – 4.7.6
    WPME Google Maps: by WPMadeasy – 2.2

    ### Settings ###

    Force SSL: –
    Currency: EUR (€)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2

    ### API ###

    API Enabled: ✔

    ### WC Pages ###

    Shop Base: #2747 – /products/
    Cart: ❌ Page not set
    Checkout: ❌ Page not set
    My Account: ❌ Page not set

    ### Taxonomies ###

    Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)

    ### Theme ###

    Name: Jollyall
    Version: 1.0.0
    Author URL: http://themeforest.net/user/jollythemes
    Child Theme: ❌ – If you’re modifying WooCommerce on a parent theme you didn’t build personally
    then we recommend using a child theme. See: How to create a child theme

    WooCommerce Support: ✔

    ### Templates ###

    Overrides: jollyall/woocommerce/archive-product.php
    jollyall/woocommerce/cart/cart-empty.php
    jollyall/woocommerce/cart/cart-item-data.php version 2.1.0 is out of date. The core version is 2.4.0
    jollyall/woocommerce/cart/cart-shipping.php version 2.1.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/cart/cart-totals.php version 2.1.0 is out of date. The core version is 2.3.6
    jollyall/woocommerce/cart/cart.php version 2.1.0 is out of date. The core version is 2.3.8
    jollyall/woocommerce/cart/cross-sells.php
    jollyall/woocommerce/cart/mini-cart.php version 2.1.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/cart/shipping-calculator.php
    jollyall/woocommerce/checkout/cart-errors.php version 1.6.4 is out of date. The core version is 2.4.0
    jollyall/woocommerce/checkout/form-billing.php
    jollyall/woocommerce/checkout/form-checkout.php version 2.0.0 is out of date. The core version is 2.3.0
    jollyall/woocommerce/checkout/form-coupon.php
    jollyall/woocommerce/checkout/form-login.php
    jollyall/woocommerce/checkout/form-pay.php version 1.6.4 is out of date. The core version is 2.5.0
    jollyall/woocommerce/checkout/form-shipping.php
    jollyall/woocommerce/checkout/review-order.php version 2.1.8 is out of date. The core version is 2.3.0
    jollyall/woocommerce/checkout/thankyou.php
    jollyall/woocommerce/content-product.php version 1.6.4 is out of date. The core version is 2.6.1
    jollyall/woocommerce/content-product_cat.php version 1.6.4 is out of date. The core version is 2.6.1
    jollyall/woocommerce/content-single-product.php
    jollyall/woocommerce/content-widget-product.php version – is out of date. The core version is 2.5.0
    jollyall/woocommerce/emails/admin-new-order.php version 2.0.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/emails/customer-completed-order.php version 1.6.4 is out of date. The core version is 2.5.0
    jollyall/woocommerce/emails/customer-invoice.php version 2.2.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/emails/customer-new-account.php
    jollyall/woocommerce/emails/customer-note.php version 1.6.4 is out of date. The core version is 2.5.0
    jollyall/woocommerce/emails/customer-processing-order.php version 1.6.4 is out of date. The core version is 2.5.0
    jollyall/woocommerce/emails/customer-reset-password.php
    jollyall/woocommerce/emails/email-addresses.php version 2.2.0 is out of date. The core version is 2.4.0
    jollyall/woocommerce/emails/email-footer.php version 2.0.0 is out of date. The core version is 2.3.0
    jollyall/woocommerce/emails/email-header.php version 2.0.0 is out of date. The core version is 2.4.0
    jollyall/woocommerce/emails/email-order-items.php
    jollyall/woocommerce/emails/plain/admin-new-order.php version 2.0.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/emails/plain/customer-completed-order.php version 2.0.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/emails/plain/customer-invoice.php version 2.2.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/emails/plain/customer-new-account.php
    jollyall/woocommerce/emails/plain/customer-note.php version 2.0.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/emails/plain/customer-processing-order.php version 2.2.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/emails/plain/customer-reset-password.php version 2.0.0 is out of date. The core version is 2.3.0
    jollyall/woocommerce/emails/plain/email-addresses.php
    jollyall/woocommerce/emails/plain/email-order-items.php
    jollyall/woocommerce/global/breadcrumb.php version 2.2.0 is out of date. The core version is 2.3.0
    jollyall/woocommerce/global/form-login.php
    jollyall/woocommerce/global/quantity-input.php version 2.1.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/global/sidebar.php
    jollyall/woocommerce/global/wrapper-end.php
    jollyall/woocommerce/global/wrapper-start.php
    jollyall/woocommerce/loop/add-to-cart.php version 2.1.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/loop/loop-end.php
    jollyall/woocommerce/loop/loop-start.php
    jollyall/woocommerce/loop/no-products-found.php
    jollyall/woocommerce/loop/orderby.php
    jollyall/woocommerce/loop/pagination.php
    jollyall/woocommerce/loop/price.php
    jollyall/woocommerce/loop/rating.php
    jollyall/woocommerce/loop/result-count.php
    jollyall/woocommerce/loop/sale-flash.php
    jollyall/woocommerce/myaccount/form-add-payment-method.php version 2.1 is out of date. The core version is 2.6.0
    jollyall/woocommerce/myaccount/form-edit-account.php version 2.2.0 is out of date. The core version is 2.6.0
    jollyall/woocommerce/myaccount/form-edit-address.php version 2.1.0 is out of date. The core version is 2.6.0
    jollyall/woocommerce/myaccount/form-login.php version 2.1.0 is out of date. The core version is 2.6.0
    jollyall/woocommerce/myaccount/form-lost-password.php version 2.0.0 is out of date. The core version is 2.6.0
    jollyall/woocommerce/myaccount/my-account.php version 2.0.0 is out of date. The core version is 2.6.0
    jollyall/woocommerce/myaccount/my-address.php version 2.2.0 is out of date. The core version is 2.6.0
    jollyall/woocommerce/myaccount/my-downloads.php
    jollyall/woocommerce/myaccount/my-orders.php
    jollyall/woocommerce/myaccount/view-order.php version 2.2.0 is out of date. The core version is 2.6.0
    jollyall/woocommerce/notices/error.php
    jollyall/woocommerce/notices/notice.php
    jollyall/woocommerce/notices/success.php
    jollyall/woocommerce/order/form-tracking.php
    jollyall/woocommerce/order/order-details.php version 2.2.0 is out of date. The core version is 2.6.0
    jollyall/woocommerce/order/tracking.php
    jollyall/woocommerce/single-product/add-to-cart/external.php
    jollyall/woocommerce/single-product/add-to-cart/grouped.php
    jollyall/woocommerce/single-product/add-to-cart/simple.php
    jollyall/woocommerce/single-product/add-to-cart/variable.php version 2.1.0 is out of date. The core version is 2.5.0
    jollyall/woocommerce/single-product/meta.php
    jollyall/woocommerce/single-product/price.php version 1.6.4 is out of date. The core version is 2.4.9
    jollyall/woocommerce/single-product/product-attributes.php
    jollyall/woocommerce/single-product/product-image.php version 2.0.14 is out of date. The core version is 2.6.3
    jollyall/woocommerce/single-product/product-thumbnails.php version 2.0.3 is out of date. The core version is 2.6.3
    jollyall/woocommerce/single-product/rating.php version 2.1.0 is out of date. The core version is 2.3.2
    jollyall/woocommerce/single-product/related.php
    jollyall/woocommerce/single-product/review.php version 2.1.0 is out of date. The core version is 2.6.0
    jollyall/woocommerce/single-product/sale-flash.php
    jollyall/woocommerce/single-product/share.php
    jollyall/woocommerce/single-product/short-description.php
    jollyall/woocommerce/single-product/tabs/additional-information.php
    jollyall/woocommerce/single-product/tabs/description.php
    jollyall/woocommerce/single-product/tabs/tabs.php version 2.0.0 is out of date. The core version is 2.4.0
    jollyall/woocommerce/single-product/title.php
    jollyall/woocommerce/single-product/up-sells.php
    jollyall/woocommerce/single-product-reviews.php version 2.1.0 is out of date. The core version is 2.3.2
    jollyall/woocommerce/single-product.php
    jollyall/woocommerce/taxonomy-product_cat.php
    jollyall/woocommerce/taxonomy-product_tag.php

    : Learn how to update outdated templates
    `’

    I would not alter the code.

    If you go to:
    Dashboard > Appearance > Menus
    on the left hand side there is a series of sections of different types of pages. Select the “Product Categories” section. If its not there, turn it on in screen options.

    Add your product categories to a menu. Even if you don’t want them in a menu permanently, you will be able to use the menu links to capture your product categories urls. These links should give you one page per category.

    Typically, product category links for an “imported” category would be:
    http://www.my-site.com/shop/product-category/imported
    Your url formats may be a bit different depending on your setup, permalink settings and language.

    A different approach would be to use shortcodes:
    https://docs.woocommerce.com/document/woocommerce-shortcodes/

    So you would setup an ordinary page and put on the shortcode:
    [product_category category=”imported”]
    There are more parameters you can use, see the shortcodes page. You can have a unique page per category. The drawback is that shortcodes don’t have pagination, so all the items in the category must fit on one page.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Separate Categories in each page’ is closed to new replies.