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

New features #143

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

vidmantaskiro
Copy link
Contributor

No description provided.

@vidmantaskiro vidmantaskiro requested a review from a team as a code owner December 18, 2024 07:42
defined( 'ABSPATH' ) || die( 'no direct access' );

/**
* Omnisend Batch class. It should be used with Omnisend Client.
Copy link
Contributor

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.
Copy link
Contributor

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' );
Copy link
Contributor

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;
Copy link
Contributor

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 {
Copy link
Contributor

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?

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

Successfully merging this pull request may close these issues.

2 participants