This repository was archived by the owner on Oct 27, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,7 @@ public function salePrice()
161
161
}
162
162
if ($ saleEnd ) {
163
163
$ saleEnd = new Carbon ($ saleEnd ->value );
164
+ $ saleEnd = $ saleEnd ->endOfDay ();
164
165
}
165
166
166
167
if ($ saleStart ) {
Original file line number Diff line number Diff line change @@ -343,6 +343,24 @@ public function test_sale_price_with_missing_start_date_before_but_end_date_is_a
343
343
$ this ->assertEquals ('9.99 ' , $ product ->load ('customAttributes ' )->salePrice ());
344
344
}
345
345
346
+ public function test_sale_price_runs_through_current_date_on_special_to_date ()
347
+ {
348
+ $ product = MagentoProductFactory::new ()->create ();
349
+
350
+ $ product ->customAttributes ()->create ([
351
+ 'attribute_type ' => 'special_price ' ,
352
+ 'attribute_type_id ' => MagentoCustomAttributeTypeFactory::new ()->create (),
353
+ 'value ' => '9.99 ' ,
354
+ ]);
355
+ $ product ->customAttributes ()->create ([
356
+ 'attribute_type ' => 'special_to_date ' ,
357
+ 'attribute_type_id ' => MagentoCustomAttributeTypeFactory::new ()->create (),
358
+ 'value ' => today ()->format ('Y-m-d H:i:s ' ),
359
+ ]);
360
+
361
+ $ this ->assertEquals ('9.99 ' , $ product ->load ('customAttributes ' )->salePrice ());
362
+ }
363
+
346
364
public function test_configurable_links_has_many_products_through ()
347
365
{
348
366
$ configurableProduct = MagentoProductFactory::new ()->create ();
You can’t perform that action at this time.
0 commit comments