bigcommerce-for-wordpress icon indicating copy to clipboard operation
bigcommerce-for-wordpress copied to clipboard

Adds support for fetching BigCommerce Products by SKU. Including via shortcode

Open emiliorcueto opened this issue 4 years ago • 3 comments

Adds support for fetching BigCommerce Products by SKU.

  • Adds static methods by_product_sku and query to the BigCommerce\Post_Types\Product class
  • Add default attribute of sku to the Product_Components class implementing the bc-component shortcode

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"]');

emiliorcueto avatar Apr 30 '21 16:04 emiliorcueto

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

karmatosed avatar Aug 30 '24 14:08 karmatosed

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.

karmatosed avatar Sep 16 '24 16:09 karmatosed

Agreed. @emiliorcueto would you mind providing a little more info here?

chanceaclark avatar Sep 17 '24 20:09 chanceaclark