Home Forums Basel support forum Custom Fields, Brand | Year/Season | Gender

Custom Fields, Brand | Year/Season | Gender

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #3418

    olanygards
    Participant

    Hello!

    I would like to enter and show custom fields / taxonomies associated to a product.

    Brand
    Year/Season
    Gender

    I have seen a plug-in that could do the job, https://sv.wordpress.org/plugins/types/

    I can get these custom fields to show up when entering all the information, but I can’t show the info.

    I also get an error message in the plug-in “Your theme’s template file for displaying Product items is missing custom fields.”

    Do you know if this could be implemented in the Basel theme?

    And if so, where I should look.

    Thank you

    #3423

    Artem Temos
    Keymaster

    Hello,

    Thank you for purchasing our theme.

    Unfortunately, we didn’t test our theme with this plugin and can’t say how it will work with Basel. But we suggest to use woocommerce product attributes functionality for this purpose. Just create some attributes (taxonomies) via Dashboard -> Products -> Attributes and associate them with products. Here is a documentation that may help you https://docs.woocommerce.com/document/managing-product-taxonomies/#section-3

    Regards

    #3438

    olanygards
    Participant

    Thanks, that will hopefully work!

    But Is is possible to control the display of each attribute?

    Now everything is listed under Additional Information

    I find that this is coming from

    “<?php $product->list_attributes(); ?>” in additional-information.php

    But can I make a selection here instead of showing all Attributes?

    For example, “Season” attribute is only for us internally. This is not something we would like to show as a “tag” on the product page or selectable sort value in the shop listings. But just for us to be able to make selections to show these products as a group or slide.

    Example that we wish to have a page with last Seasons products. Then use the selection Attribute “last year” for a special page. But we don’t want to show everywhere that some products are last years.

    Also, I would like to be able to control how to display the information from the Attribute “Brand”.

    In our case, I would like to show the value from the Attribute “Brand” on top of Product Title.

    (See example: https://dl.dropboxusercontent.com/u/297430/Screenshot-2016-09-02-07_57_43.png )

    Many thanks

    Ola

    #3449

    Artem Temos
    Keymaster

    We understand your request. But the problem is that you task may need additional customization, and according to Envato Support Policy in is out of our support scope.

    Thanks for understanding.

    #3455

    olanygards
    Participant

    Hello!

    Well yes, I do understand that it will take some customization.

    I will not ask for code or guide on that to do. But if you by any chance can point me in the right direction would be wonderful.

    Like:
    Check these files and look up on custom attributes or likewise.

    Highest prio is how to implement the attribute above the title.

    I would love to get some minor directions.

    (I just bought 6 month of extra support a few days ago, and I haven’t got any help before)

    Thanks
    Ola

    #3458

    Artem Temos
    Keymaster

    You will find single product page code in the file basel/woocommerce/content-single-product.php. Just add the code that will display your attribute under the title after this line

    <div class="basel-scroll-content">

    Probably you will find the necessary code on some of the following articles

    https://wordpress.org/support/topic/how-to-pull-custom-attributes-for-product-on-shopcategory-page/
    https://docs.woocommerce.com/document/display-product-attribute-archive-links/

    #3489

    olanygards
    Participant

    Perfect, Thank you so much!

    I used the following to display the brand above the product title.

    <div class=”brandClass”>
    <?php
    $brandvalues = get_the_terms( $product->id, ‘pa_brand’);
    if ( $brandvalues && ! is_wp_error( $brandvalues)):
    foreach ( $brandvalues as $brandvalue ) {
    echo $brandvalue->name;
    }
    endif;
    ?></div>

    (My attibute is called “brand” and I placed the code where your told me).

    #3492

    Artem Temos
    Keymaster

    We are happy that you found the solution!

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