-
Notifications
You must be signed in to change notification settings - Fork 2
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
New features #143
base: main
Are you sure you want to change the base?
New features #143
Conversation
defined( 'ABSPATH' ) || die( 'no direct access' ); | ||
|
||
/** | ||
* Omnisend Batch class. It should be used with Omnisend Client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Category class
defined( 'ABSPATH' ) || die( 'no direct access' ); | ||
|
||
/** | ||
* Omnisend Batch class. It should be used with Omnisend Client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Product class
} | ||
|
||
if ( $this->sku !== null && strlen( $this->sku ) > 100 ) { | ||
$error->add( 'default_image_url', 'SKU must be under 100 characters' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SKU, not default_image_url
} | ||
|
||
if ( ! empty( $this->variants ) ) { | ||
$arr['variants'] = $this->variants; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you use productVariant
method to_array
here? Also, product validation should validate variants and reuse productVariant
validation, because I think you will be sending and creating products and variant is a child of a product and you dont want to call separate methods and deal with it
Or perhaps I am missing something here? How are you planing to use them from client?
* | ||
* @return void | ||
*/ | ||
public function set_items( $items ): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are you planing to validate items? Because they can be product, category etc and as I understand batch methods will be used to create all of these items.
How would you create a batch of products and send them via this method? Would to_array generate correct request?
No description provided.