Skip to content

Multi-site configuration #76

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
11 changes: 11 additions & 0 deletions .idea/laravel-woocommerce.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/phpunit.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

87 changes: 87 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/Models/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Attribute extends BaseModel
*/
protected function getTerms($attribute_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("products/attributes/{$attribute_id}/terms")
->all($options);
}
Expand All @@ -37,7 +37,7 @@ protected function getTerms($attribute_id, $options = [])
*/
protected function getTerm($attribute_id, $term_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("products/attributes/{$attribute_id}/terms")
->find($term_id, $options);
}
Expand All @@ -52,7 +52,7 @@ protected function getTerm($attribute_id, $term_id, $options = [])
*/
protected function addTerm($attribute_id, $data)
{
return Query::init()
return Query::init($this->config)
->setEndpoint("products/attributes/{$attribute_id}/terms")
->create($data);
}
Expand All @@ -68,7 +68,7 @@ protected function addTerm($attribute_id, $data)
*/
protected function updateTerm($attribute_id, $term_id, $data)
{
return Query::init()
return Query::init($this->config)
->setEndpoint("products/attributes/{$attribute_id}/terms")
->update($term_id, $data);
}
Expand All @@ -84,7 +84,7 @@ protected function updateTerm($attribute_id, $term_id, $data)
*/
protected function deleteTerm($attribute_id, $term_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("products/attributes/{$attribute_id}/terms")
->delete($term_id, $options);
}
Expand All @@ -99,7 +99,7 @@ protected function deleteTerm($attribute_id, $term_id, $options = [])
*/
protected function batchTerm($attribute_id, $data)
{
return Query::init()
return Query::init($this->config)
->setEndpoint("products/attributes/{$attribute_id}/terms")
->batch($data);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Customer extends BaseModel
*/
protected function downloads($id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("customers/{$id}/downloads")
->all($options);
}
Expand Down
14 changes: 7 additions & 7 deletions src/Models/Note.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Note extends BaseModel
*/
protected function all($order_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/notes")
->all($options);
}
Expand All @@ -37,7 +37,7 @@ protected function all($order_id, $options = [])
*/
protected function find($order_id, $note_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/notes")
->find($note_id, $options);
}
Expand All @@ -52,7 +52,7 @@ protected function find($order_id, $note_id, $options = [])
*/
protected function create($order_id, $data)
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/notes")
->create($data);
}
Expand All @@ -68,7 +68,7 @@ protected function create($order_id, $data)
*/
protected function delete($order_id, $note_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/notes")
->delete($note_id, $options);
}
Expand All @@ -90,7 +90,7 @@ protected function paginate(
$current_page = 1,
$options = []
) {
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/notes")
->paginate($per_page, $current_page, $options);
}
Expand All @@ -104,7 +104,7 @@ protected function paginate(
*/
protected function count($order_id)
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/notes")
->count();
}
Expand All @@ -118,7 +118,7 @@ protected function count($order_id)
*/
public function save($order_id)
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/notes")
->save();
}
Expand Down
16 changes: 8 additions & 8 deletions src/Models/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Order extends BaseModel
*/
protected function notes($order_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/notes")
->all($options);
}
Expand All @@ -37,7 +37,7 @@ protected function notes($order_id, $options = [])
*/
protected function note($order_id, $note_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/notes")
->find($note_id, $options);
}
Expand All @@ -52,7 +52,7 @@ protected function note($order_id, $note_id, $options = [])
*/
protected function createNote($order_id, $data = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/notes")
->create($data);
}
Expand All @@ -68,7 +68,7 @@ protected function createNote($order_id, $data = [])
*/
protected function deleteNote($order_id, $note_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/notes")
->delete($note_id, $options);
}
Expand All @@ -83,7 +83,7 @@ protected function deleteNote($order_id, $note_id, $options = [])
*/
protected function refunds($order_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/refunds")
->all($options);
}
Expand All @@ -99,7 +99,7 @@ protected function refunds($order_id, $options = [])
*/
protected function refund($order_id, $refund_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/refunds")
->find($refund_id, $options);
}
Expand All @@ -114,7 +114,7 @@ protected function refund($order_id, $refund_id, $options = [])
*/
protected function createRefund($order_id, $data = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/refunds")
->create($data);
}
Expand All @@ -130,7 +130,7 @@ protected function createRefund($order_id, $data = [])
*/
protected function deleteRefund($order_id, $refund_id, $options = [])
{
return Query::init()
return Query::init($this->config)
->setEndpoint("orders/{$order_id}/refunds")
->delete($refund_id, $options);
}
Expand Down
Loading