-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
$botamp->setApiBase( BOTAMP_API_BASE ); | ||
} | ||
$botamp->entities->all(); | ||
$botamp = $this->get_botamp(); |
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 $this->botamp?
|
||
$entity_attributes = [ | ||
'title' => $order_id . ' ' . $order->customer_user, | ||
'description' => 'Woocommerce order', |
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.
You can make entity description optional in Botamp instead of this workaround.
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.
ok
private function create_entity( $order_id ) { | ||
$order = new WC_Order( $order_id ); | ||
$order_metas = [ | ||
'total' => $order->order_total, |
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 there be other data sent than the total?
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.
Yes, probably the list of bought items.
'title' => $order_id . ' ' . $order->customer_user, | ||
'description' => 'Woocommerce order', | ||
'url' => $order->get_view_order_url(), | ||
'image_url' => '', |
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.
Is this line necessary?
…rder notifications
); | ||
|
||
register_setting( $this->plugin_name, $this->option( 'order_notifications' ) ); | ||
} |
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.
is it possible to abstract all the woocommerce related code from BotampAdmin to a BotampWoocommerceAdmin?
size='standard'> | ||
</div></div>"; | ||
|
||
} |
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.
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 ); | ||
} |
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.
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?
…_Admin and Botamp_Woocommerce_Public
# Conflicts: # admin/class-botamp-admin.php # includes/class-botamp.php # public/class-botamp-public.php
No description provided.