Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1489442

    Hi, QQ about the shop page:

    https://www.bonjiglass.com/shop/

    I’m expanding into merch and other things, but I want that url with just “shop” to still only house the bongs and bong related items. Is that possible?
    Basically I would want the default build in /shop URL to only show the items under “Bong Related” category.

    I want to then make Apparel and other Categories, but I don’t want them to show up under “shop” URL. I want to link to them directly on the drop down via the category specific URL

    Is this possible?

    Also, is it possible to have multiple iterations of the shop banner. Like for the merch shop page… can I have a separate version of these 2 sections:

    View post on imgur.com

    Best,
    -Daniel

    #1489445

    Hey Dzimnikov,

    Thank you for the inquiry.

    You can try adding this code to the functions.php file to exclude other categories from the main shop page. Make sure to replace the values in the terms array with the actual slugs of the categories you want to exclude.

    add_action( 'pre_get_posts', 'ava_exclude_categories_from_shop' );
    
    function ava_exclude_categories_from_shop( $query ) {
    
        if ( is_admin() || ! $query->is_main_query() || ! is_shop() ) {
            return;
        }
    
        $query->set( 'tax_query', array(
            array(
                'taxonomy' => 'product_cat',
                'field'    => 'slug',
                'terms'    => array( 'other-products', 'more-products' ), // Categories to exclude
                'operator' => 'NOT IN',
            ),
        ));
    }

    Best regards,
    Ismael

    #1489608

    This removes the products from the shop list… but not from the categories:

    View post on imgur.com

    I would want to remove the category from just the main shop page. I can use a page number identifier and remove it with CSS right?

    It also makes the SHOP page… 2 pages… instead of just one. Which isn’t ideal, I would prefer that people keep scrolling, rather than have to press next page

    -Also, what about my other question from above? Regarding a different banner for each shop page?

    -Also, another question, is there a way to control which categories Start out Open… vs Closed on the Shop pages?
    Like on the Main Shop Page… I want to Give people the option to search by Liquor Type. I don’t want the subcategories below it (like tequila, vodka, etc) to show up automatically, I’d like it to remain closed until a visitor clicks it?

    Another weird thing, when I add in the Spirits Category, the system for whatever reason pushes it to the top:

    View post on imgur.com

    Even though alphabetically it should be below. I have no idea why thats happening

    • This reply was modified 1 week, 2 days ago by Dzimnikov.
    • This reply was modified 1 week, 2 days ago by Dzimnikov.
    • This reply was modified 1 week, 2 days ago by Dzimnikov.
    #1489633

    Hi,

    Thank you for the update.

    Looks like you have successfully removed the category from the sidebar filter. For the banner, you can duplicate the ava_custom_add_shipping_text_script function in your functions.php file and customize it for each category as needed.

    function ava_custom_add_shipping_text_script_category() {
        if ( is_product_category( array( 'apparel', 'bong' ) ) ) {
            ?>
            <script>
                (function ($) {
                    $(document).ready(function () {
                        var newContainer = $('<div class="av-custom-shipping-container"><p>Free Shipping (USA) - Orders $35+<br><p><font size="6px">International Shipping Available - All Pieces Dab Compatible</font></p></div>');
                        $('#av_product_description .container').after(newContainer);
                    });
                }(jQuery));
            </script>
            <?php
        }
    }
    add_action('wp_footer', 'ava_custom_add_shipping_text_script_category', 99);
    
    

    If you have any additional questions at this time we kindly ask that you open them up in a separate thread. The longer threads get in the forum, they become more difficult to support as they tend to drift off topic and they also make it troublesome for users trying to search for solutions. Keeping threads relevant to their original inquiry ensures that we can keep better track of what has been resolved and that users can more effectively find answers to similar issues they might be experiencing.

    Thanks!

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.