titodevera
Forum Replies Created
-
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] Need HelpHello krish9091.
What shortcode are you using? are you talking about a static page that you created through WordPress admin panel?
Thanks
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] How to change displayHello. I think that the simplest solution is to do it with CSS:
.single-product .pwb-single-product-brands:before{ content: "Brand: "; }
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] Description on [pwb-all-brands] short codeThis option is unavailable. I will consider to include it for next plugin releases.
Thanks for using PWB ??
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] page viewHello. Which page view (archive page, single product, page…) is? Can you give us a public link to this page? Are you using a shortcode?
Thanks for using PWB ??
Yes, I agree with you. I will include this improve on next plugin release. Thanks ??
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] Change of PermalinkYes. It is posible find out if a product has a brand assigned or not… But if you leave the empty $slug, the products which have no brands assigned will throw a 404 error on his single page.
You can add a separator between them using CSS:
.single-product .pwb-single-product-brands a:last-child:before{ content: " - "; }
On single product page, the brands will be ordered alphabetically. I will consider improve it for next plugin version.
Thanks
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] Change of PermalinkBy the way, I noticed when a product doesn’t have a brand assigned, its URL will be domain-name/products/brand/product-name. How do I make into, domain-name/products/product-name, which removes ‘brand’ from the URL?
It is not posible remove it, but you can customize it as you want. Change this line:
$slug = 'brand'; //default
in the code aboveForum: Plugins
In reply to: [Perfect Brands for WooCommerce] Change of PermalinkFor example, I added “Brand A” as a parent brand, and “Brand B” as its child brand, the product URL only shows its parent brand, i.e., domain-name/products/Brand-A/product-name. Ideally, it should be domain-name/products/Brand-A/Brand-B/product-name.
Try this code:
function pwb_brand_permalink($permalink, $post, $leavename) { if (strpos($permalink, '%pwb-brand%') === FALSE) return $permalink; $product_brands = wp_get_object_terms($post->ID, 'pwb-brand'); $slug = 'brand'; //default if ( ! empty( $product_brands ) ) { if ( ! is_wp_error( $product_brands ) ) { $first_brand = key( array_slice( $product_brands, 0, 1, true ) ); $last_brand = key( array_slice( $product_brands, -1, 1, true ) ); if ( $first_brand === $last_brand ) { //only one brand $slug = $product_brands[$first_brand]->slug; } else { //more than one brand $slug = ''; foreach ($product_brands as $key => $brand) { $slug .= $brand->slug; if($key != $last_brand){ $slug .= '/'; } } } } } return str_replace('%pwb-brand%', $slug , $permalink); } include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if(is_plugin_active('woocommerce/woocommerce.php') && is_plugin_active('perfect-woocommerce-brands/main.php')){ add_filter('post_link', 'pwb_brand_permalink', 10, 3); add_filter('post_type_link', 'pwb_brand_permalink', 10, 3); }
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] Change of PermalinkMany thanks, titodevera.
Won’t it be better to replace is_plugin_active(‘woocommerce/woocommerce.php’) and is_plugin_active(‘perfect-woocommerce-brands/main.php’) with class_exists( ‘WooCommerce’ ) and class_exists( ‘Perfect_Woocommerce_Brands’ ) respectively?
I’m yet to try out your solution. Will update here again soon.
From my point of view is more reliable to use
is_plugin_active
.PWB uses php namespaces. If you want to check if a PWB class exists you should indicate the namespace before the name of the class. Something like this:
class_exists( '\Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands' );
Hello. Can you provide us a link of your site to test it?
Thanks
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] Change of PermalinkIt’s posible.
1) Add this code to your functions.php
function pwb_brand_permalink($permalink, $post, $leavename) { if (strpos($permalink, '%pwb-brand%') === FALSE) return $permalink; $product_brands = wp_get_object_terms($post->ID, 'pwb-brand'); $slug = 'brand'; //default if ( ! empty( $product_brands ) ) { if ( ! is_wp_error( $product_brands ) ) { foreach( $product_brands as $brand ) { $slug = $brand->slug; } } } return str_replace('%pwb-brand%', $slug , $permalink); } include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if(is_plugin_active('woocommerce/woocommerce.php') && is_plugin_active('perfect-woocommerce-brands/main.php')){ add_filter('post_link', 'pwb_brand_permalink', 10, 3); add_filter('post_type_link', 'pwb_brand_permalink', 10, 3); }
2) Go to ‘Settings > Permalinks’ and set the custom base (for ‘Product Permalinks’):
/products/%pwb-brand%
Don′t forget to save changes.??
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] Use Brand name in Shopping feed pluginHello Uthoocha. Can you tell me which plugin are you using to generate the feed?
Google allows to add brand’s name to Google Shopping feeds. Depending on which plugin you are using to generate the feed maybe can be posible.
Thanks
Forum: Plugins
In reply to: [Perfect Brands for WooCommerce] change link of BrandI think this topic is resolved ??
Well. When you click on a brand, your site loads the “archive-product” template (from WooCommerce).
If your catalog images are too small:
1) You should configure image sizes going to “WooCommerce > Settings > Display”.
2) Configure the columns width with css (on current theme). Something like this:ul.products li.product { width: 46.2%!important; }
Like you can see, your problem doesn′t have relation with this plugin.
If you have more doubts about this, i think you should ask here:
https://www.ads-software.com/support/plugin/woocommerceThanks ??