Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

emiliorcueto
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant