dmax48
Forum Replies Created
-
Hi Jeroen,
I just wanted to update you and anyone else following that the folks at Beaver Builder (perhaps with your cooperation) have added the necessary functionality so that your plugin will now work with their new Beaver Themer product. All is good!
If anyone needs more specifics, please let me know.
Best,
DaveHi Jeroen,
I think it has to do with the fact that BB is pulling the products to the page via shortcode. Their new product, which is a theme builder, will pull the WC template to the page.
BTW, I did have the WPPP plugin enabled and configured. I also created a WC shop page and your plugin worked fine on that page. I just couldn’t use BB page builder to create custom content above and below the products without going the shortcode route, which I need to do for this project. It turns out we don’t really need this functionality for three months or so. The new BB product should be ready by then and I should be able to use your plugin.
Thanks again for your attention to this. I’ll update you when I confirm this works and also post it in the BB Facebook group in case others are looking for a solution like this.
Best,
DaveHi Jeroen,
I added the updated code to the theme functions.php file and added the [wppp] shortcode to the same HTML module where I placed the WooCommerce product shortcode, but no product per page dropdown appears. I received a response to my support inquiry to Beaver Builder and it seems they are working on a product that will pull the WC template onto their builder page, which should allow your plugin to work. They expect this to go beta in a month or so.
I appreciate your efforts to help. If I figure another way, I’ll update you in case someone else runs into this.
Thanks,
DaveThanks for making this effort, Jeroen. I added the above snippet to the child theme function.php, but it didn’t work (broke the site). Should I be adding it elsewhere (e.g., the BB WC module “woocommerce.php”)?
Best,
Dave
Thanks for your reply, Jeroen. I’m not particularly proficient at coding, but here’s the php for the BB WooCommerce module (frontend.php):
// Opening Wrapper
echo ‘<div class=”fl-woocommerce-‘ . $settings->layout . ‘”>’;// Shortcodes
$pages = array(
‘cart’ => ‘[woocommerce_cart]’,
‘checkout’ => ‘[woocommerce_checkout]’,
‘tracking’ => ‘[woocommerce_order_tracking]’,
‘account’ => ‘[woocommerce_my_account]’
);// WooCommerce Pages
if(isset($pages[$settings->layout])) {
echo $pages[$settings->layout];
}// Multiple Products
else if($settings->layout == ‘products’) {
add_filter(‘post_class’, array($module, ‘products_post_class’));// Product IDs
if($settings->products_source == ‘ids’) {
echo ‘[products ids=”‘. $settings->product_ids .'” columns=”‘. $settings->columns .'” orderby=”‘. $settings->orderby .'” order=”‘. $settings->order .'”]’;
}// Product Category
else if($settings->products_source == ‘category’) {
echo ‘[product_category category=”‘. $settings->category_slug .'” per_page=”‘. $settings->num_products .'” columns=”‘. $settings->columns .'” orderby=”‘. $settings->orderby .'” order=”‘. $settings->order .'”]’;
}// Recent Products
else if($settings->products_source == ‘recent’) {
echo ‘[recent_products per_page=”‘. $settings->num_products .'” columns=”‘. $settings->columns .'” orderby=”‘. $settings->orderby .'” order=”‘. $settings->order .'”]’;
}// Featured Products
else if($settings->products_source == ‘featured’) {
echo ‘[featured_products per_page=”‘. $settings->num_products .'” columns=”‘. $settings->columns .'” orderby=”‘. $settings->orderby .'” order=”‘. $settings->order .'”]’;
}// Sale Products
else if($settings->products_source == ‘sale’) {
echo ‘[sale_products per_page=”‘. $settings->num_products .'” columns=”‘. $settings->columns .'” orderby=”‘. $settings->orderby .'” order=”‘. $settings->order .'”]’;
}// Best Selling Products
else if($settings->products_source == ‘best-selling’) {
echo ‘[best_selling_products per_page=”‘. $settings->num_products .'” columns=”‘. $settings->columns .'”]’;
}// Top Rated Products
else if($settings->products_source == ‘top-rated’) {
echo ‘[top_rated_products per_page=”‘. $settings->num_products .'” columns=”‘. $settings->columns .'” orderby=”‘. $settings->orderby .'” order=”‘. $settings->order .'”]’;
}remove_filter(‘post_class’, array($module, ‘products_post_class’));
}// Closing Wrapper
echo ‘</div>’;___________________________________________________
Here’s the woocommerce.php for the BB WC module:
<?php
/**
* @class FLWooCommerceModule
*/
class FLWooCommerceModule extends FLBuilderModule {/**
* @method __construct
*/
public function __construct()
{
$enabled = class_exists(‘Woocommerce’);parent::__construct(array(
‘name’ => __(‘WooCommerce’, ‘fl-builder’),
‘description’ => __(‘Display products or categories from your WooCommerce store.’, ‘fl-builder’),
‘category’ => __(‘Advanced Modules’, ‘fl-builder’),
‘enabled’ => $enabled,
‘partial_refresh’ => true
));
}/**
* @method products_post_class
*/
public function products_post_class($classes)
{
$classes[] = ‘product’;return $classes;
}/**
* @method single_product_post_class
*/
public function single_product_post_class($classes)
{
$classes[] = ‘product’;
$classes[] = ‘single-product’;return $classes;
}
}/**
* Register the module and its form settings.
*/
FLBuilder::register_module(‘FLWooCommerceModule’, array(
‘general’ => array(
‘title’ => __(‘General’, ‘fl-builder’),
‘sections’ => array(
‘general’ => array(
‘title’ => ”,
‘fields’ => array(
‘layout’ => array(
‘type’ => ‘select’,
‘label’ => __(‘Layout’, ‘fl-builder’),
‘default’ => ”,
‘options’ => array(
” => __(‘Choose…’, ‘fl-builder’),
‘product’ => __(‘Single Product’, ‘fl-builder’),
‘product_page’ => __(‘Product Page’, ‘fl-builder’),
‘products’ => __(‘Multiple Products’, ‘fl-builder’),
‘add-cart’ => __( ‘”Add to Cart” Button’, ‘fl-builder’ ),
‘categories’ => __(‘Categories’, ‘fl-builder’),
‘cart’ => __(‘Cart’, ‘fl-builder’),
‘checkout’ => __(‘Checkout’, ‘fl-builder’),
‘tracking’ => __(‘Order Tracking’, ‘fl-builder’),
‘account’ => __(‘My Account’, ‘fl-builder’)
),
‘toggle’ => array(
‘product’ => array(
‘fields’ => array(‘product_id’)
),
‘product_page’ => array(
‘fields’ => array(‘product_id’)
),
‘products’ => array(
‘sections’ => array(‘multiple_products’)
),
‘add-cart’ => array(
‘fields’ => array(‘product_id’)
),
‘categories’ => array(
‘fields’ => array(‘parent_cat_id’, ‘cat_columns’)
)
)
),
‘product_id’ => array(
‘type’ => ‘text’,
‘label’ => __(‘Product ID’, ‘fl-builder’),
‘default’ => ”,
‘size’ => ‘4’,
‘help’ => __(‘As you add products in the WooCommerce Products area, each will be assigned a unique ID. You can find this unique product ID by visiting the Products area and rolling over the product. The unique ID will be the first attribute.’, ‘fl-builder’)
),
‘parent_cat_id’ => array(
‘type’ => ‘text’,
‘label’ => __(‘Parent Category ID’, ‘fl-builder’),
‘default’ => ‘0’,
‘size’ => ‘4’,
‘help’ => __(‘As you add product categories in the WooCommerce Products area, each will be assigned a unique ID. This ID can be found by hovering on the category in the categories area under Products and looking in the URL that is displayed in your browser. The ID will be the only number value in the URL.’, ‘fl-builder’)
),
‘cat_columns’ => array(
‘type’ => ‘select’,
‘label’ => __(‘Columns’, ‘fl-builder’),
‘default’ => ‘4’,
‘options’ => array(
‘1’ => ‘1’,
‘2’ => ‘2’,
‘3’ => ‘3’,
‘4’ => ‘4’
)
)
)
),
‘multiple_products’ => array(
‘title’ => __(‘Multiple Products’, ‘fl-builder’),
‘fields’ => array(
‘products_source’ => array(
‘type’ => ‘select’,
‘label’ => __(‘Products Source’, ‘fl-builder’),
‘default’ => ‘ids’,
‘options’ => array(
‘ids’ => __(‘Products IDs’, ‘fl-builder’),
‘category’ => __(‘Product Category’, ‘fl-builder’),
‘recent’ => __(‘Recent Products’, ‘fl-builder’),
‘featured’ => __(‘Featured Products’, ‘fl-builder’),
‘sale’ => __(‘Sale Products’, ‘fl-builder’),
‘best-selling’ => __(‘Best Selling Products’, ‘fl-builder’),
‘top-rated’ => __(‘Top Rated Products’, ‘fl-builder’)
),
‘toggle’ => array(
‘ids’ => array(
‘fields’ => array(‘product_ids’, ‘columns’, ‘orderby’, ‘order’)
),
‘category’ => array(
‘fields’ => array(‘category_slug’, ‘num_products’, ‘columns’, ‘orderby’, ‘order’)
),
‘recent’ => array(
‘fields’ => array(‘num_products’, ‘columns’, ‘orderby’, ‘order’)
),
‘featured’ => array(
‘fields’ => array(‘num_products’, ‘columns’, ‘orderby’, ‘order’)
),
‘sale’ => array(
‘fields’ => array(‘num_products’, ‘columns’, ‘orderby’, ‘order’)
),
‘best-selling’ => array(
‘fields’ => array(‘num_products’, ‘columns’)
),
‘top-rated’ => array(
‘fields’ => array(‘num_products’, ‘columns’, ‘orderby’, ‘order’)
)
)
),
‘product_ids’ => array(
‘type’ => ‘text’,
‘label’ => __(‘Product IDs’, ‘fl-builder’),
‘default’ => ”,
‘help’ => __(‘As you add products in the WooCommerce Products area, each will be assigned a unique ID. You can find this unique product ID by visiting the Products area and rolling over the product. The unique ID will be the first attribute and you can add several here separated by a comma.’, ‘fl-builder’)
),
‘category_slug’ => array(
‘type’ => ‘text’,
‘label’ => __(‘Category Slug’, ‘fl-builder’),
‘default’ => ”,
‘help’ => __(‘As you add product categories in the WooCommerce Products area, each will be assigned a unique slug or you can edit and add your own. These slugs can be found in the Categories area under WooCommerce Products. Several can be added here separated by a comma.’, ‘fl-builder’)
),
‘num_products’ => array(
‘type’ => ‘text’,
‘label’ => __(‘Number of Products’, ‘fl-builder’),
‘default’ => ’12’,
‘size’ => ‘4’
),
‘columns’ => array(
‘type’ => ‘select’,
‘label’ => __(‘Columns’, ‘fl-builder’),
‘default’ => ‘4’,
‘options’ => array(
‘1’ => ‘1’,
‘2’ => ‘2’,
‘3’ => ‘3’,
‘4’ => ‘4’
)
),
‘orderby’ => array(
‘type’ => ‘select’,
‘label’ => __(‘Sort By’, ‘fl-builder’),
‘default’ => ‘menu_order’,
‘options’ => array(
‘menu_order’ => _x( ‘Default’, ‘Sort by.’, ‘fl-builder’ ),
‘popularity’ => __(‘Popularity’, ‘fl-builder’),
‘rating’ => __(‘Rating’, ‘fl-builder’),
‘date’ => __(‘Date’, ‘fl-builder’),
‘price’ => __(‘Price’, ‘fl-builder’)
)
),
‘order’ => array(
‘type’ => ‘select’,
‘label’ => __(‘Sort Direction’, ‘fl-builder’),
‘default’ => ‘menu_order’,
‘options’ => array(
‘ASC’ => __(‘Ascending’, ‘fl-builder’),
‘DESC’ => __(‘Descending’, ‘fl-builder’)
)
)
)
)
)
)
));___________________________________________________________________________________
It seems BB is using WC shortcodes for the module and I don’t know how it can allow pagination. I know you can’t provide custom coding, but I can post this issue on the BB Facebook group to see if anyone there can provide help. Perhaps there’s another approach I can take. If there’s anything you see, though, that you think might work for this please let me know.
Thanks again.
Dave
Fair enough. However, how is it an “attack” to state the facts? I didn’t do any name-calling, etc. And this was NOT a security vulnerability issue. IMO, bringing this issue to the attention of the community is being the best kind of community member.
If you look at the comments on the WordFence founder’s blog post about this subject today, I think you’ll see how overwhelmingly this position is supported. I’d say your opinion is definitely swimming upstream on this but, of course, you’re entitled to it.
I understand the guidelines in place for plugins. However, if an egregious violation like this one doesn’t fall under item 18 of the guidelines, I don’t know what would.
Item 18 of the guidelines for everyone’s reference:
“We reserve the right to arbitrarily disable or remove any plugin for any reason whatsoever. Basically, this is our repository, and we will attempt to maintain a standard of conduct and code quality. We may not always succeed, but that is our goal, and we will do whatever we feel is necessary in furtherance of that goal.”