Git Product home page Git Product logo

Comments (9)

VerdiH avatar VerdiH commented on September 26, 2024

Is there a PHP-snippet to do this in the meantime (until hopefully, one day Astra implements this)?

from astra.

VerdiH avatar VerdiH commented on September 26, 2024

Update: Do not use this script, it does not look good on mobile.

I got this back from support just now:

There is no such option is available to show the category description on the shop page.

You can add following code snippet to your child theme's functions.php file to add Category Description to the shop page.

We are going to release the theme update today itself after updating the theme the following code snippet doesn't require any style. As of now if you add this code snippet then you might need to style this description as per your requirement.

add_action( 'wp', 'single_product_variable_loggedin_user' );
function single_product_variable_loggedin_user() {
add_action( 'woocommerce_after_subcategory', 'astra_product_archive_description' );
}

/**
* Show Category Description on shop page
*
* @param object $category     Category object
*/
function astra_product_archive_description( $category ){

$cat_id=$category->term_id;
$prod_term = get_term($cat_id,'product_cat');
$description = $prod_term->description;
echo '<div class="ast-woo-shop-product-description"><p>'.$description.'</p></div>';
}

Not sure if I'm reading this correctly, but it seems this is coming to the theme today by default.

from astra.

Nikschavan avatar Nikschavan commented on September 26, 2024

In the upcoming update we will be fixing the CSS bug that is making the category/subcategory title go below the description in your case - https://cl.ly/pPiD

You will still have to add this php snippet to display this description though.

from astra.

VerdiH avatar VerdiH commented on September 26, 2024

Thank you for your reply @Nikschavan. Just curious, why not included this in Astra Core? It seems like such an obvious feature to include.

Cheers

from astra.

Nikschavan avatar Nikschavan commented on September 26, 2024

My current thoughts are -

  • Since this has been off from the initial design, Turning it on automatically in an update is a backward compatibility breakage. People using categories on their sites with current layout will automatically start seeing the descriptions in their completed websites.
  • This should come as an option which will be by default off, but right now there does not seem to be other settings specifically for the archives.

I have added this to our list to consider the best approach for this.

from astra.

VerdiH avatar VerdiH commented on September 26, 2024

Ok, thank you @Nikschavan I'll wait for the update before proceeding.

from astra.

Nikschavan avatar Nikschavan commented on September 26, 2024

Astra Pro v1.2.0 did update fix this CSS breakage when the description is added using the filter so you can use this filter on your site.

We do have few more improvements to the category display on the shop page which will provide more style options in future updates of Astra Pro.

from astra.

VerdiH avatar VerdiH commented on September 26, 2024

Thank you @Nikschavan I've just tried it out and it works now. Cheers.

from astra.

VerdiH avatar VerdiH commented on September 26, 2024

@Nikschavan It works great on our corporate site too (ignore the design, still working on it)

One question though: For products, there is this awesome shadow hover effect. But not for categories? How do I get them the same (for consistency).

Cheers

Ps. no hurry, it's not a bug, just weird.

from astra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.