Skip to content

Commit

Permalink
fix upselling code
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Aug 14, 2024
1 parent 87340c7 commit 1608f2d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Upselling.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,25 @@ public function applyUpselling($cart) {
]);
//order findwhere created_at >= now()->subDay()


Log::info('Processing order found '.json_encode($processingOrder));
Log::info("Processing Data:". now()->subDay());
Log::error('Processing order email '.$cart->customer_email);
Log::error('Processing order cart '.json_encode($cart));
Log::error('Processing order found '.json_encode($processingOrder));
Log::error("Processing Data:". now()->subDay());


if(!$processingOrder) {
if($processingOrder) {
//Log::info('Processing order found '.json_encode($processingOrder));

Cart::saveShippingMethod('free_free');

// Apply coupon code
Cart::setCouponCode('hao123');
$coupon_code = "upselling50";
Cart::setCouponCode($coupon_code)->collectTotals();




Cart::collectTotals();
// Cart::collectTotals();

Log::info('Processing order cart found '.json_encode($cart));
}
Expand Down

0 comments on commit 1608f2d

Please sign in to comment.