Home Forums WoodMart support forum different headers for each category in the catalog and in product cards

different headers for each category in the catalog and in product cards

Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #301162

    loralora
    Participant

    Hi, I had a question about the possibility of using different headers for each category in the catalog and in product cards.
    For example, automatically assign header 1 for the dress category and for all products that are included in the dress category with header 1.
    And for the category of glasses and all products that belong to the category of glasses, header 2.

    We have already discussed this topic (see the link) https://xtemos.com/forums/topic/different-header-for-different-parent-categories/ and as far as I understand this function should be added to this update of the topic. But I can’t find it?

    Please tell me where can I find this setting?

    #301210

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to do this. Replace ids 10 and 11 with your categories ids and header_576762 with header ids.

    add_filter(
    	'woodmart_get_current_header_id',
    	function ( $id ) {
    		if ( is_product_category() && is_object( get_queried_object() ) ) {
    			if ( get_queried_object()->term_id == 10 ) {
    				return 'header_576762';
    			} elseif ( get_queried_object()->term_id == 11 ) {
    				return 'header_496420';
    			}
    		}
    		return $id;
    	}
    );

    Best Regards

    #301459

    loralora
    Participant

    Hi yes this works, but only for the parent category. But when you go to a subcategory, the default header is loaded. Also, the header that is specified in this function is not displayed on the product page, but the default header is used.

    How can you do so that:

    Category1, all subcategories of category 1, all products that are in category 1 and subcategories 1 have a header xx1

    Category 2, all subcategories of category 2, all products that fell into category 2 and subcategories 2 had a header xx2?

    thanks a lot

    #301480

    Hello,

    Please delete the code and create the presets for each category: https://gyazo.com/58950d2cc0ee70a500889fed573af890 and set the header in the Theme Settings > General

    You can find more details about the presets here: https://xtemos.com/docs/woodmart/faq-guides/woodmart-update-6-0-explained/

    If you have any question please feel free to contact

    Best Regards

    #301543

    loralora
    Participant

    it’s just amazing! This is the coolest feature of the theme.

    Everything works fine for me with header displays in categories and subcategories.

    But somehow it doesn’t work on the individual product page.
    Please see what am I doing wrong?

    Attachments:
    You must be logged in to view attached files.
    #301573

    Hello,

    The product page has the option just inside the page: https://gyazo.com/ab0f354a10b032d852881ff96c28fce9

    If you have any questions please feel free to contact us.

    Best Regards

    #301723

    loralora
    Participant

    Yes, I have already used this function, but I have a multi-vendor, and the supplier himself will load the product from his panel.

    Maybe there is some other way to do this automatically?

    #301910

    Hello,

    Please try to configure the presets in the Theme Settings: https://take.ms/vzbYe

    Best Regards

    #302211

    loralora
    Participant

    this does not work :(((

    #302425

    Hello,

    What theme version do you have now? Please update till 6.1.2 if your version is oder.

    Best Regard

    #302527

    loralora
    Participant

    Hi, thanks for your support,
    I updated the version to the one you specified (for some reason, updates from the console do not work for me and I have to download from themeforest) and made the necessary settings, but for some reason it does not work.

    #302617

    Hello,

    Sorry for the inconvenience, what version do you have now? Please update up to 6.1.3 and check.

    Best Regards

    #302676

    loralora
    Participant

    Hi, I have updated to the latest version, please see the screen.
    Can this happen if I am using a child theme?

    Attachments:
    You must be logged in to view attached files.
    #302753

    Hello,

    Yes, deactivate all the plugins not related to the theme, switch the parent theme, and check the issue.

    Best Regards

    #302760

    loralora
    Participant

    i did all these steps but it doesn’t work

    #302866

    Hello,

    Please, provide your site admin access to the private area.

    Best Regards

    #303161

    loralora
    Participant

    ok

    #303217

    Hello,

    I have checked the product, I set different headers here only: https://gyazo.com/c1d53f511bace04ddc35d6fab0a28d2b
    and it works: https://gyazo.com/87ffa6201a4e64110ca9d82dc3348d0b

    Please disable the cache while editing or clear the cache each time.

    Best Regards

    #303301

    loralora
    Participant

    it only works on one product, the “Мужское” id 233 category.
    Moreover, in the same category there are 2 products, and on one product it works (exactly the product the video from which you sent me) and on the other not. Watch the video.

    Before all the manipulations, I cleared the cache and disabled all plugins from caching.

    And I used the same settings for the “Женское” id 232 category, but it doesn’t work at all.

    P.S. when saving the rule settings, the page sometimes does not respond due to the total, you have to wait a little

    #303304

    loralora
    Participant

    even now I have deactivated all plugins, except for those who are related to woodmart and woocomerce, but this also does not solve the problem

    #303322

    loralora
    Participant

    There are small conditions for everything to work:

    1. The product card must indicate not only the subcategory, but also the parent category.

    2. The settings must contain the settings for the single product page.

    I no longer have a question for this thread, you can mark it as resolved.

    #303557

    Hello,

    Please update the site credentials and keep them valid till we solve the issue.

    Best Regards

Viewing 22 posts - 1 through 22 (of 22 total)