Skip to content

Commit

Permalink
Merge pull request #85 from moderntribe/release/0.14.0
Browse files Browse the repository at this point in the history
Package version 0.14.0
  • Loading branch information
bookernath authored Nov 2, 2018
2 parents c2efced + a721898 commit 9a82b99
Show file tree
Hide file tree
Showing 57 changed files with 5,728 additions and 1,517 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [0.14.0]

### Added

- Introduced embedded checkout, with an option in the admin to disable it.

### Fixed

- Fixed a typo in the order summary template path. Order history should load correctly now.
- Replaced obsolete information regarding API credentials in the plugin readme.

## [0.13.0]

### Added
Expand All @@ -26,6 +37,9 @@
- Removed ability to edit Product post slug. The slug is imported from the Catalog API.
- Removed the Import Settings metabox obviated by the Channels API.

### Fixed
- Fixed the cart tax total to refresh when cart quantities change.

## [0.12.0]
### Added
- Added the Product Sync feature to Product List page.
Expand Down Expand Up @@ -123,6 +137,7 @@


[Unreleased]: https://github.com/moderntribe/bigcommerce/compare/master...develop
[0.14.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/0.13.0...0.14.0
[0.13.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/0.12.0...0.13.0
[0.12.0]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/0.11.1...0.12.0
[0.11.1]: https://github.com/bigcommerce/bigcommerce-for-wordpress/compare/0.11.0...0.11.1
Expand Down
42 changes: 9 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,15 @@ As with any WordPress plugin, upload the plugin ZIP file to the
* SSL
* The PHP intl extension will enable better currency formatting

### BigCommerce API Account

To connect with your BigCommerce account, you first must create an API Account.

To create an API account, visit the [API Accounts page under Advanced
Settings](https://login.bigcommerce.com/deep-links/settings/auth/api-accounts) in
your BigCommerce store admin.

Click the "Create API Account" button at the top of the page to create a new account,
and grant it all privileges. (Currently "Content", "Marketing", and "Themes" permissions
are not used, but they may be added to the plugin in the future.)

Make note of the following information about your API account:

* API Path (similar to `https://api.bigcommerce.com/stores/abc9defghi/v3/`)
* Client ID
* Client Secret
* Access Token

### Settings

Find the BigCommerce settings screen at BigCommerce -> Settings in the WordPress
admin menu.

#### API Credentials

For the plugin for function properly, it must be connected to the BigCommerce API.
Copy your account credentials into the "API Credentials" section.

#### Product Sync

Once your API credentials are validated, the plugin will import products using
the BigCommerce API. This will run automatically using WordPress cron, using the schedule
Once authenticated with the BigCommerce API, the plugin will import products.
This will run automatically using WordPress cron, using the schedule
set on the settings page (default: daily).

If you choose to disable the cron job, you can set a server-side cron job to run the sync
Expand All @@ -57,11 +33,9 @@ using WP-CLI. The command to import products is:
wp bigcommerce import products
```

Product descriptions can be edited in the WordPress admin. The "Do not update products
on import" setting should remain checked to preserve these edits. If it is unchecked,
those edits will be overwritten with data from the API on the next import. No matter the
value of the checkbox, other product details (e.g., prices, availability, categories) will
always be synchronized.
Product titles, descriptions, and post statuses can be edited in the
WordPress admin. Your changes will be automatically synced with your
BigCommerce channel and preserved during future imports.

#### Cart Settings

Expand Down Expand Up @@ -148,8 +122,10 @@ command: `wp bigcommerce import products`

The import runs in several stages:

1. A list of all products from the API is added to a queue for processing.
1. Any products on the site that are no longer available in the BigCommerce store are
1. If your channel does not currently have any listings, all products from
the store will be added to the channel.
1. A list of all products from the channel is added to a queue for processing.
1. Any products on the site that are no longer available in the BigCommerce channel are
marked for deletion.
1. The queue is processed in chunks (five items at a time), whereby products are imported,
updated, or deleted to match the data in BigCommerce.
Expand Down
Binary file added assets/img/admin/Gutenberg-Block_Checkout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 69 additions & 48 deletions assets/js/dist/admin/gutenberg/scripts.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/js/dist/admin/gutenberg/scripts.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/js/dist/admin/scripts.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/js/dist/admin/scripts.min.js

Large diffs are not rendered by default.

5,148 changes: 4,479 additions & 669 deletions assets/js/dist/scripts.js

Large diffs are not rendered by default.

28 changes: 26 additions & 2 deletions assets/js/dist/scripts.min.js

Large diffs are not rendered by default.

1,118 changes: 514 additions & 604 deletions assets/js/dist/vendor.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/js/dist/vendor.min.js

Large diffs are not rendered by default.

13 changes: 1 addition & 12 deletions assets/js/src/admin/gutenberg/blocks/account-profile/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
* @description Account profile block save method.
*/

const saveBlock = (props) => {
const { shortcode } = props.attributes;


return (
<div
className={props.className}
>
{ shortcode }
</div>
);
};
const saveBlock = props => props.attributes.shortcode;

export default saveBlock;
13 changes: 1 addition & 12 deletions assets/js/src/admin/gutenberg/blocks/address-list/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
* @description Address list block save method.
*/

const saveBlock = (props) => {
const { shortcode } = props.attributes;


return (
<div
className={props.className}
>
{ shortcode }
</div>
);
};
const saveBlock = props => props.attributes.shortcode;

export default saveBlock;
13 changes: 1 addition & 12 deletions assets/js/src/admin/gutenberg/blocks/cart/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
* @description Cart block save method.
*/

const saveBlock = (props) => {
const { shortcode } = props.attributes;


return (
<div
className={props.className}
>
{ shortcode }
</div>
);
};
const saveBlock = props => props.attributes.shortcode;

export default saveBlock;
74 changes: 74 additions & 0 deletions assets/js/src/admin/gutenberg/blocks/checkout/checkout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/**
* @module Gutenberg
* @description Register the Cart Gutenberg block
*/

import { GUTENBERG_CHECKOUT as BLOCK } from '../../config/gutenberg-settings';
import editBlock from './edit';
import saveBlock from './save';

/**
* @function registerBlock
* @description register the block
*/

export default {
id: BLOCK.name,
title: BLOCK.title,

/**
* An icon property should be specified to make it easier to identify a block.
* These can be any of WordPress’ Dashicons, or a custom svg element.
* @see https://developer.wordpress.org/resource/dashicons/
*/
icon: 'money',

/**
* Blocks are grouped into categories to help with browsing and discovery.
* The categories provided by core are common, embed, formatting, layout, and widgets.
*/
category: BLOCK.category,

/**
* Additional keywords to surface this block via search input. Limited to 3.
*/
keywords: BLOCK.keywords,

/**
* Optional block extended support features.
*/
supports: {
// Removes support for an HTML mode.
html: false,
},

/**
* Attributes used to save and edit our block.
*/
attributes: {
shortcode: {
type: 'string',
default: '',
},
},

/**
* The edit function describes the structure of the block in the context of the editor.
* This represents what the editor will render when the block is used.
* @see https://wordpress.org/gutenberg/handbook/block-edit-save/#edit
*
* @param {Object} [props] Properties passed from the editor.
* @return {Element} Element to render.
*/
edit: editBlock,

/**
* The save function defines the way in which the different attributes should be combined
* into the final markup, which is then serialized by Gutenberg into `post_content`.
* @see https://wordpress.org/gutenberg/handbook/block-edit-save/#save
*
* @param {Object} [props] Properties passed from the editor.
* @return {Element} Element to render.
*/
save: saveBlock,
};
34 changes: 34 additions & 0 deletions assets/js/src/admin/gutenberg/blocks/checkout/edit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @module Edit
* @description Checkout block edit method.
*/


import { ADMIN_IMAGES } from '../../../config/wp-settings';
import { GUTENBERG_CHECKOUT as BLOCK } from '../../config/gutenberg-settings';

const editBlock = (props) => {
const { setAttributes } = props;
const blockImage = `${ADMIN_IMAGES}Gutenberg-Block_Checkout.png`;

setAttributes({
shortcode: BLOCK.shortcode,
});

return [
<h2
className={props.className}
key="checkout-shortcode-title"
>
{ BLOCK.block_html.title }
</h2>,
<img
src={blockImage}
alt={BLOCK.title}
className={props.className}
key="checkout-shortcode-preview"
/>,
];
};

export default editBlock;
8 changes: 8 additions & 0 deletions assets/js/src/admin/gutenberg/blocks/checkout/save.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @module Save
* @description Checkout block save method.
*/

const saveBlock = props => props.attributes.shortcode;

export default saveBlock;
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
* @description Gift Certificate Balance block save method.
*/

const saveBlock = (props) => {
const { shortcode } = props.attributes;


return (
<div
className={props.className}
>
{ shortcode }
</div>
);
};
const saveBlock = props => props.attributes.shortcode;

export default saveBlock;
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
* @description Gift Certificate Form block save method.
*/

const saveBlock = (props) => {
const { shortcode } = props.attributes;


return (
<div
className={props.className}
>
{ shortcode }
</div>
);
};
const saveBlock = props => props.attributes.shortcode;

export default saveBlock;
2 changes: 2 additions & 0 deletions assets/js/src/admin/gutenberg/blocks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import products from './products/products';
import cart from './cart/cart';
import checkout from './checkout/checkout';
import account from './account-profile/account-profile';
import address from './address-list/address-list';
import orders from './order-history/order-history';
Expand All @@ -18,6 +19,7 @@ const { registerBlockType } = wp.blocks;
const blocks = [
products,
cart,
checkout,
account,
address,
orders,
Expand Down
13 changes: 1 addition & 12 deletions assets/js/src/admin/gutenberg/blocks/login-form/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
* @description Login Form block save method.
*/

const saveBlock = (props) => {
const { shortcode } = props.attributes;


return (
<div
className={props.className}
>
{ shortcode }
</div>
);
};
const saveBlock = props => props.attributes.shortcode;

export default saveBlock;
13 changes: 1 addition & 12 deletions assets/js/src/admin/gutenberg/blocks/order-history/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
* @description Order History block save method.
*/

const saveBlock = (props) => {
const { shortcode } = props.attributes;


return (
<div
className={props.className}
>
{ shortcode }
</div>
);
};
const saveBlock = props => props.attributes.shortcode;

export default saveBlock;
13 changes: 1 addition & 12 deletions assets/js/src/admin/gutenberg/blocks/registration-form/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
* @description Registration Form block save method.
*/

const saveBlock = (props) => {
const { shortcode } = props.attributes;


return (
<div
className={props.className}
>
{ shortcode }
</div>
);
};
const saveBlock = props => props.attributes.shortcode;

export default saveBlock;
1 change: 1 addition & 0 deletions assets/js/src/admin/gutenberg/config/gutenberg-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export const gutenbergconfig = window.bigcommerce_gutenberg_config || {};
export const GUTENBERG_BLOCKS = gutenbergconfig.blocks || {};
export const GUTENBERG_PRODUCTS = GUTENBERG_BLOCKS['bigcommerce/products'] || {};
export const GUTENBERG_CART = GUTENBERG_BLOCKS['bigcommerce/cart'] || {};
export const GUTENBERG_CHECKOUT = GUTENBERG_BLOCKS['bigcommerce/checkout'] || {};
export const GUTENBERG_ACCOUNT = GUTENBERG_BLOCKS['bigcommerce/account-profile'] || {};
export const GUTENBERG_ADDRESS = GUTENBERG_BLOCKS['bigcommerce/address-list'] || {};
export const GUTENBERG_ORDERS = GUTENBERG_BLOCKS['bigcommerce/order-history'] || {};
Expand Down
Loading

0 comments on commit 9a82b99

Please sign in to comment.