Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Woocommerce integration #1

Merged
merged 40 commits into from
Dec 21, 2016
Merged

Woocommerce integration #1

merged 40 commits into from
Dec 21, 2016

Conversation

ousmanedev
Copy link
Contributor

No description provided.

$botamp->setApiBase( BOTAMP_API_BASE );
}
$botamp->entities->all();
$botamp = $this->get_botamp();
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 $this->botamp?


$entity_attributes = [
'title' => $order_id . ' ' . $order->customer_user,
'description' => 'Woocommerce order',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make entity description optional in Botamp instead of this workaround.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

private function create_entity( $order_id ) {
$order = new WC_Order( $order_id );
$order_metas = [
'total' => $order->order_total,
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 there be other data sent than the total?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, probably the list of bought items.

'title' => $order_id . ' ' . $order->customer_user,
'description' => 'Woocommerce order',
'url' => $order->get_view_order_url(),
'image_url' => '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line necessary?

);

register_setting( $this->plugin_name, $this->option( 'order_notifications' ) );
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to abstract all the woocommerce related code from BotampAdmin to a BotampWoocommerceAdmin?

size='standard'>
</div></div>";

}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this method and all the other ones which hook into the frontend in the admin class?

$entity_attributes['meta'] = $this->get_order_meta( $order );

$this->botamp->entities->update( $entity_id, $entity_attributes );
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this code to an entity class or something, same for create, etc. And subscription stuff to a subscription class and so on for other types of data?

@ousmanedev ousmanedev self-assigned this Dec 21, 2016
@ousmanedev ousmanedev merged commit 1fbe9e7 into master Dec 21, 2016
@ousmanedev ousmanedev deleted the woocommerce-integration branch December 21, 2016 03:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants