Skip to content

Commit

Permalink
Ticket #4459 - Apps Market in Studio should support inline SVG in app…
Browse files Browse the repository at this point in the history
…'s cover.
  • Loading branch information
AntonLV committed Aug 30, 2024
1 parent 8641530 commit 339e40d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
30 changes: 22 additions & 8 deletions studio/template/scripts/BxBaseStudioStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -820,13 +820,21 @@ protected function displayProducts($mixedItems, $aParams = array())
$bIcon = strpos($sIcon, '.') !== false;

$sImage = '';
if(!empty($aItem['cover']['medium']))
$sImage = $aItem['cover']['medium'];
else if(!empty($aItem['cover']['large']))
$sImage = $aItem['cover']['large'];
else if(!empty($aItem['cover']['big']))
$sImage = $aItem['cover']['big'];
$bImage = !empty($sImage) && strpos($sImage, '.') !== false;
$bImage = $bImageRaw = false;
if(empty($aItem['cover_raw'])) {
if(!empty($aItem['cover']['medium']))
$sImage = $aItem['cover']['medium'];
else if(!empty($aItem['cover']['large']))
$sImage = $aItem['cover']['large'];
else if(!empty($aItem['cover']['big']))
$sImage = $aItem['cover']['big'];

$bImage = !empty($sImage) && strpos($sImage, '.') !== false;
}
else {
$sImage = $aItem['cover_raw'];
$bImageRaw = true;
}

$aTmplVarsRate = array();
$bTmplVarsRate = $bShowRating && !$bShoppingCart;
Expand Down Expand Up @@ -861,7 +869,7 @@ protected function displayProducts($mixedItems, $aParams = array())
),
),
'bx_if:no_image' => array (
'condition' => !$bImage,
'condition' => !$bImage && !$bImageRaw,
'content' => array(
'description_plain' => $aItem['description_plain'],
'strecher' => mb_strlen($aItem['description_plain']) > 240 ? '' : str_repeat('      ', round((240 - mb_strlen($aItem['description_plain'])) / 6))
Expand All @@ -874,6 +882,12 @@ protected function displayProducts($mixedItems, $aParams = array())
'strecher' => str_repeat('      ', 40)
),
),
'bx_if:image_raw' => array (
'condition' => $bImageRaw,
'content' => array(
'image_raw' => $sImage,
),
),
'title' => $aItem['title'],
'bx_if:show_vendor' => array(
'condition' => !$bShoppingCart,
Expand Down
5 changes: 5 additions & 0 deletions studio/template/str_product_v2.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
<div class="bx-std-product-strecher">__strecher__</div>
</div>
</bx_if:image>
<bx_if:image_raw>
<div class="bx-std-pc-cover bx-def-gal-div-size bx-def-font-middle">
__image_raw__
</div>
</bx_if:image_raw>
</div>
<!-- Title section -->
<div class="bx-std-product-title bx-def-padding-sec">
Expand Down

0 comments on commit 339e40d

Please sign in to comment.