Get Date End of product's price
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Get Date End of product's price
Hi, I want to add a progress bar that indicates how much time remains for the offer.
I've added this code in price-standard.php file to add the bar:
But, how I've specified in #todo, I don't have the function to get the end date of the product's price.
Is there any function to get this value?
Aimeos: aimeos/aimeos-laravel 2020.10.6
PHP 7.4.3
I've added this code in price-standard.php file to add the bar:
Code: Select all
<p>
<span class="offer"><?= $enc->html(__("Offer expires in:")); $priceItem->get; ?></span>
<span class="progress m-b-5">
<span class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%"><?= #TODO add code for get DateEnd ?> </span>
</span>
</p>
Is there any function to get this value?
Aimeos: aimeos/aimeos-laravel 2020.10.6
PHP 7.4.3
Re: Get Date End of product's price
The start/end date is stored in the list item that references the price item. Instead of using
use
Code: Select all
$priceItems = $product->getRefItems( 'price', 'default', default' );
Code: Select all
$listItems = $product->getListItems( 'price', 'default', default' );
foreach( $listItems as $listItem ) {
$datetime = $listItem->getDateEnd();
$priceItem = $listItem->getRefItem();
}
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star