Adds support for fetching BigCommerce Products by SKU. Including via shortcode
Adds support for fetching BigCommerce Products by SKU.
- Adds static methods
by_product_skuandqueryto theBigCommerce\Post_Types\Productclass - Add default attribute of
skuto theProduct_Componentsclass implementing thebc-componentshortcode
Documentation
Historically, one would only be able to fetch a product with a BigCommerce Product ID
E.g. $product = \BigCommerce\Post_Types\Product\Product::by_product_id( $product_id );
This pull request adds the ability to fetch of a product in a very similar fashion by BigCommerce Product SKU
E.g. $product = \BigCommerce\Post_Types\Product\Product::by_product_sku( $product_sku );
Additionally, the bc-component shortcode attributes have been updated to support fetching by BigCommerce Product SKU as well.
E.g. echo do_shortcode('[bc-component sku="' . $product_sku . '" type="add_to_cart"]');
This PR currently needs a refresh along with consideration whether still an issue. As we were triaging the repo this month, my recommendation would be to either refresh and get into the next release or to close out. If it is due to get in then I would recommend having an issue to link with it which unless I am mistaken I don't see.
cc @chanceaclark and @bc-erich
I am struggling to recreate this. I think this could be myself or it might be that this isn't an issue anymore. My thinking however is we need to have a few more things on this PR to ensure testing can be done and also get a refresh.
Agreed. @emiliorcueto would you mind providing a little more info here?