On envoie à l'API beds24 le prix de la chambre
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
/web/cache/
|
||||||
|
/web/assets/
|
||||||
|
/log/
|
||||||
@@ -115,6 +115,19 @@ class Beds24Request
|
|||||||
$lastNight = $booking->getEndDate();
|
$lastNight = $booking->getEndDate();
|
||||||
$lastNight->sub(new \DateInterval("P1D"));
|
$lastNight->sub(new \DateInterval("P1D"));
|
||||||
|
|
||||||
|
$price = $booking->getOrder()->getTotalAmount();
|
||||||
|
$taxe = $booking->getOrderProduct()->getOrderProductTaxes()->getFirst();
|
||||||
|
$tva = $taxe->getAmount();
|
||||||
|
|
||||||
|
$invoiceArray = array();
|
||||||
|
$invoiceArray['description'] = "Location";
|
||||||
|
$invoiceArray['status'] = "Paid";
|
||||||
|
$invoiceArray['qty'] = 1;
|
||||||
|
$invoiceArray['price'] = $price;
|
||||||
|
$invoiceArray['vatRate'] = 20;
|
||||||
|
$invoiceArray['type'] = 1;
|
||||||
|
$invoiceArray['invoiceId'] = "";
|
||||||
|
|
||||||
$requestParameters = [
|
$requestParameters = [
|
||||||
"roomId" => $booking->getRoomId(),
|
"roomId" => $booking->getRoomId(),
|
||||||
"roomQty" => 1,
|
"roomQty" => 1,
|
||||||
@@ -134,6 +147,12 @@ class Beds24Request
|
|||||||
"guestPostcode"=> $address->getZipcode(),
|
"guestPostcode"=> $address->getZipcode(),
|
||||||
"guestCountry"=> $address->getCountry()->setLocale($locale)->getTitle(),
|
"guestCountry"=> $address->getCountry()->setLocale($locale)->getTitle(),
|
||||||
|
|
||||||
|
"price" => $price,
|
||||||
|
"deposit" => 0,
|
||||||
|
"tax" => $tva,
|
||||||
|
"commission" => 0,
|
||||||
|
"invoice" => $invoiceArray
|
||||||
|
|
||||||
// "notifyGuest" => true,
|
// "notifyGuest" => true,
|
||||||
// "notifyHost" => true
|
// "notifyHost" => true
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class RoomAvailability extends BaseLoop implements ArraySearchLoopInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// print_r($result);
|
//print_r($result);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,20 +160,21 @@
|
|||||||
{$available = false}
|
{$available = false}
|
||||||
|
|
||||||
{* Si le bien est dispo aux dates mémorisées on prend le prix indiqué *}
|
{* Si le bien est dispo aux dates mémorisées on prend le prix indiqué *}
|
||||||
{loop type="beds24.availability" name="disponibilite" product_id=$product_id use_saved_search_criteria=true}
|
{ifloop rel='disponibilite'}
|
||||||
{$available = true}
|
{loop type="beds24.availability" name="disponibilite" product_id=$product_id use_saved_search_criteria=true}
|
||||||
<span class="regular-price col-xs-12">
|
{$available = true}
|
||||||
<span itemprop="price" class="price">
|
<span class="regular-price col-xs-12">
|
||||||
<span class="special-price"><span class="price-label">{intl l="Special Price:"} </span><span class="price"{if $PRICE neq $PRICE_REMISE} style="text-decoration:line-through;"{/if}>{format_money number=$PRICE symbol={currency attr="symbol"}}</span></span>
|
<span itemprop="price" class="price">
|
||||||
|
<span class="special-price"><span class="price-label">{intl l="Special Price:"} </span><span class="price"{if $PRICE neq $PRICE_REMISE} style="text-decoration:line-through;"{/if}>{format_money number=$PRICE symbol={currency attr="symbol"}}</span></span>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
{if $PRICE neq $PRICE_REMISE}
|
||||||
{if $PRICE neq $PRICE_REMISE}
|
Prix remisé : <span class="price_remise"><strong>{format_money number=$PRICE_REMISE symbol={currency attr="symbol"}}</strong></span>
|
||||||
Prix remisé : <span class="price_remise"><strong>{format_money number=$PRICE_REMISE symbol={currency attr="symbol"}}</strong></span>
|
- Remise : -<span class="remise">{$REMISE}</span>%
|
||||||
- Remise : -<span class="remise">{$REMISE}</span>%
|
- Nb jours : <span class="nb_jours">{$NB_JOURS}</span> jour(s)
|
||||||
- Nb jours : <span class="nb_jours">{$NB_JOURS}</span> jour(s)
|
{/if}
|
||||||
{/if}
|
{/loop}
|
||||||
{/loop}
|
{/ifloop}
|
||||||
|
|
||||||
{elseloop rel='disponibilite'}
|
{elseloop rel='disponibilite'}
|
||||||
{* Pas de dispo avec les paramètres mémorisés récupérer le prix mini *}
|
{* Pas de dispo avec les paramètres mémorisés récupérer le prix mini *}
|
||||||
{loop type="beds24.description" name="description" product_id=$product_id}
|
{loop type="beds24.description" name="description" product_id=$product_id}
|
||||||
@@ -188,7 +189,7 @@
|
|||||||
{else}
|
{else}
|
||||||
{$available = true}
|
{$available = true}
|
||||||
|
|
||||||
{* List of condition : NewCondition, DamagedCondition, UsedCondition, RefurbishedCondition *}
|
{* List of condition : NewCondition, DamagedCondition, UsedCondition, RefurbishedCondition *}
|
||||||
<meta itemprop="itemCondition" itemtype="http://schema.org/ItemCondition" content="NewCondition">
|
<meta itemprop="itemCondition" itemtype="http://schema.org/ItemCondition" content="NewCondition">
|
||||||
{* List of currency : The currency used to describe the product price, in three-letter ISO format. *}
|
{* List of currency : The currency used to describe the product price, in three-letter ISO format. *}
|
||||||
<meta itemprop="priceCurrency" content="{currency attr="code"}">
|
<meta itemprop="priceCurrency" content="{currency attr="code"}">
|
||||||
|
|||||||
Reference in New Issue
Block a user