@@ -0,0 +1,88 @@ | |||
<?php | |||
namespace Lc\ShopBundle\Model; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Symfony\Component\HttpFoundation\File\File; | |||
use Vich\UploaderBundle\Mapping\Annotation as Vich; | |||
trait OpenGraphTrait | |||
{ | |||
/** | |||
* @ORM\Column(type="string", nullable=true) | |||
*/ | |||
protected $openGraphTitle; | |||
/** | |||
* @ORM\Column(type="text", nullable=true) | |||
*/ | |||
protected $openGraphDescription; | |||
/** | |||
* @ORM\Column(type="string", length=255, nullable=true) | |||
*/ | |||
protected $openGraphImage; | |||
/** | |||
* @Vich\UploadableField(mapping="images", fileNameProperty="openGraphImage") | |||
* @var File | |||
*/ | |||
protected $openGraphImageFile; | |||
public function getOpenGraphTitle(): ?string | |||
{ | |||
return $this->openGraphTitle; | |||
} | |||
public function setOpenGraphTitle(string $openGraphTitle): self | |||
{ | |||
$this->openGraphTitle = $openGraphTitle; | |||
return $this; | |||
} | |||
public function getOpenGraphDescription(): ?string | |||
{ | |||
return $this->openGraphDescription; | |||
} | |||
public function setOpenGraphDescription(?string $openGraphDescription): self | |||
{ | |||
$this->openGraphDescription = $openGraphDescription; | |||
return $this; | |||
} | |||
public function getOpenGraphImage(): ?string | |||
{ | |||
return $this->openGraphImage; | |||
} | |||
public function setOpenGraphImage(?string $openGraphImage): self | |||
{ | |||
$this->openGraphImage = $openGraphImage; | |||
return $this; | |||
} | |||
public function setOpenGraphImageFile(File $openGraphImageFile = null) | |||
{ | |||
$this->openGraphImageFile = $openGraphImageFile; | |||
// VERY IMPORTANT: | |||
// It is required that at least one field changes if you are using Doctrine, | |||
// otherwise the event listeners won't be called and the file is lost | |||
if ($openGraphImageFile) { | |||
// if 'updatedAt' is not defined in your entity, use another property | |||
$this->updatedAt = new \DateTime('now'); | |||
} | |||
} | |||
public function getOpenGraphImageFile() | |||
{ | |||
return $this->openGraphImageFile ; | |||
} | |||
} |
@@ -362,8 +362,7 @@ function resetNumItemsCollectionField($collectionWidget){ | |||
function initBtnShowTotalOrderProduct(){ | |||
log( $('.lc-show-products-sales-statistic')); | |||
$('.lc-show-products-sales-statistic').on('click', function (){ | |||
$('.lc-show-products-sales-statistic').unbind('click').on('click', function (){ | |||
$btn = $(this); | |||
var url = $(this).data('url'); | |||
$('#modal-products-sales-statistic').remove(); |
@@ -80,6 +80,8 @@ group: | |||
waitingBankReturn: Commandes en attente de retour banque | |||
list: Liste des commandes | |||
giftVoucher: Commandes de bons cadeaux | |||
multiplePayment: Paiements multiples | |||
Ticket: | |||
listMessages: Liste des messages | |||
list: Tickets ouverts | |||
@@ -298,8 +300,8 @@ field: | |||
emailFromPurchaseOrder: "Email (From) : bons de commande" | |||
order: Commande | |||
subject: Sujet | |||
metaTitle: Meta title | |||
metaDescription: Meta description | |||
metaTitle: Titre (meta) | |||
metaDescription: Description (meta) | |||
users: Utilisateurs | |||
total: Total | |||
products: Produits | |||
@@ -313,6 +315,9 @@ field: | |||
ticketTypesNotification: Catégorie ticket | |||
newsletter: Newsletter | |||
isEligibleTicketRestaurant: Éligible ticket restaurant | |||
openGraphTitle: Titre (OpenGraph) | |||
openGraphDescription: Description (OpenGraph) | |||
openGraphImageFile: Image (OpenGraph) | |||
PointSale: | |||
code: Code |
@@ -94,6 +94,7 @@ class MailjetSmsUtils | |||
return $content; | |||
} else { | |||
// log | |||
return $response->getContent() ; | |||
} | |||
} | |||
else { |
@@ -67,12 +67,14 @@ class ProductPriceUtils | |||
public function getPriceByRefUnitWithTaxAndReduction(ProductPropertyInterface $product) | |||
{ | |||
return $this->applyReductionCatalog( | |||
return ($this->getPriceByRefUnitWithTax($product) * $this->getPriceWithTaxAndReduction($product)) | |||
/ $this->getPriceWithTax($product) ; | |||
/*return $this->applyReductionCatalog( | |||
$product, | |||
$this->getPriceByRefUnit($product), | |||
$this->getPriceByRefUnitWithTax($product) | |||
); | |||
);*/ | |||
} | |||
@@ -615,5 +615,74 @@ class Utils | |||
return $phone ; | |||
} | |||
public function getMetaTitle($entity) | |||
{ | |||
if($entity) { | |||
if(method_exists($entity, 'getMetaTitle')) { | |||
return $entity->getMetaTitle() ; | |||
} | |||
elseif(method_exists($entity, 'getTitle')) { | |||
return $entity->getTitle() ; | |||
} | |||
} | |||
return '' ; | |||
} | |||
public function getMetaDescription($entity) | |||
{ | |||
if($entity) { | |||
if(method_exists($entity, 'getMetaDescription')) { | |||
return $entity->getMetaDescription() ; | |||
} | |||
elseif(method_exists($entity, 'getDescription')) { | |||
return $entity->getDescription() ; | |||
} | |||
} | |||
return '' ; | |||
} | |||
public function getOpenGraphTitle($entity) | |||
{ | |||
if($entity) { | |||
if(method_exists($entity, 'getOpenGraphTitle')) { | |||
return $entity->getOpenGraphTitle() ; | |||
} | |||
elseif(method_exists($entity, 'getTitle')) { | |||
return $entity->getTitle() ; | |||
} | |||
} | |||
return '' ; | |||
} | |||
public function getOpenGraphDescription($entity) | |||
{ | |||
if($entity) { | |||
if(method_exists($entity, 'getOpenGraphDescription')) { | |||
return $entity->getOpenGraphDescription() ; | |||
} | |||
elseif(method_exists($entity, 'getDescription')) { | |||
return $entity->getDescription() ; | |||
} | |||
} | |||
return '' ; | |||
} | |||
public function getOpenGraphImage($entity) | |||
{ | |||
if($entity) { | |||
if(method_exists($entity, 'getOpenGraphImage')) { | |||
return $entity->getOpenGraphImage() ; | |||
} | |||
elseif(method_exists($entity, 'getImage')) { | |||
return $entity->getImage() ; | |||
} | |||
} | |||
return '' ; | |||
} | |||
} |