Skip to content

Commit

Permalink
Merge pull request #56 from drzzle-app/productPriceSlashes
Browse files Browse the repository at this point in the history
new logic to show before and after pricing on product droplets
  • Loading branch information
runrog authored Jan 30, 2024
2 parents 1b9f52f + c682ff9 commit 34a9325
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/droplets/text-blob/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Vue from 'vue';

const template = require('./template.html');

export default Vue.component('text-blob-droplet', {
template,
name: 'text-blob-droplet',
});
3 changes: 3 additions & 0 deletions src/droplets/text-blob/template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>
<span class="drzBlobText-strike">Strike</span> Text.
</div>
5 changes: 5 additions & 0 deletions src/droplets/text-blob/themes/default/styles.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.drzBlobText-strike {
margin-right: 5px;
opacity: .6;
text-decoration: line-through;
}
5 changes: 5 additions & 0 deletions src/layout/side-bar/links.json
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@
"route": "/text",
"children": []
},
{
"text": "Text Blob",
"route": "/text-blob",
"children": []
},
{
"text": "Text Swapper",
"route": "/text-swapper",
Expand Down
1 change: 1 addition & 0 deletions src/less/themes/default/droplets.less
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@
@import '../../../droplets/group-list/themes/default/styles';
@import '../../../droplets/progress-bar/themes/default/styles';
@import '../../../droplets/text-swapper/themes/default/styles';
@import '../../../droplets/text-blob/themes/default/styles';
1 change: 1 addition & 0 deletions src/pages/all-droplets/all-droplets.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ export default {
'group-list': require('@/droplets/group-list'),
'progress-bar': require('@/droplets/progress-bar'),
'text-swapper': require('@/droplets/text-swapper'),
'text-blob': require('@/droplets/text-blob'),
};
20 changes: 20 additions & 0 deletions src/pages/droplets/text-blob/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Vue from 'vue';
import TextBlob from '@/droplets/text-blob';
import TextBlobTpl from '@/droplets/text-blob/template.html';
import { cleanDropletTpl } from '@/mixins/cleanDropletTpl';

const template = require('./template.html');

export default Vue.component('text-blob-page', {
template,
name: 'text-blob-page',
mixins: [cleanDropletTpl],
components: {
TextBlob,
},
data() {
return {
dropletHtml: this.cleanDropletTpl(TextBlobTpl),
};
},
});
17 changes: 17 additions & 0 deletions src/pages/droplets/text-blob/template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div>
<header class="picazzo-page-header">Text Blob</header>

<header class="picazzo-sectionHeader">Demo</header>

<div class="row">
<text-blob-droplet></text-blob-droplet>
</div>

<header class="picazzo-sectionHeader">HTML</header>

<div class="row">
<pre v-highlightjs><code class="html">{{ dropletHtml }}</code></pre>
</div>

<div class="picazzo-docFooter"></div>
</div>
5 changes: 5 additions & 0 deletions src/router/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,11 @@
"path": "/text-swapper",
"name": "text-swapper",
"component": "require('@/pages/droplets/text-swapper/').default"
},
{
"path": "/text-blob",
"name": "text-blob",
"component": "require('@/pages/droplets/text-blob/').default"
}
]
},
Expand Down
9 changes: 8 additions & 1 deletion src/tools/slide-checkout/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@
$select = $billState;
}
$select.empty().append($('<option selected value="">State</option>'));
$.each(methods.countries[val].regions, (i, country) => {
const { regions = [] } = methods.countries[val];
const sortedRegions = regions.sort((a, b) => a.name.localeCompare(b.name));
$.each(sortedRegions, (i, country) => {
$select.append($(
`<option value"${country.iso}" data-state-iso="${country.iso}" data-state-name=${country.name}>${country.name}</option>`,
));
Expand Down Expand Up @@ -684,6 +686,7 @@
<div class="drzSlideCheckout-item-detailsGrid">
<div>
<span class="drzSlideCheckout-cart-itemPrice">
${data.product.originalPrice ? `<span class="drzSlideCheckout-cart-itemPriceOriginal">${options.currency.symbol}${data.product.originalPrice}</span>` : ''}
${options.currency.symbol}${data.product.price} ${options.currency.type}
</span>
<div class="drzSlideCheckout-cart-mainBtns">
Expand Down Expand Up @@ -828,6 +831,10 @@
});
cartItems.splice(0, cartItems.length);
methods.saveCart(cartItems);
methods.totalItems = 0;
$cartCount.each(function setIconCounts() {
$(this).hide().html('');
});
$backBtn.html('Back to Store');
if (window.matchMedia(drzzle.viewports.mobile).matches) {
$('html, body').animate({ scrollTop: 0 }, 'fast');
Expand Down
7 changes: 7 additions & 0 deletions src/tools/slide-checkout/themes/default/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,13 @@
margin-bottom: @itemMargin;
}

.drzSlideCheckout-cart-itemPriceOriginal {
margin-right: 3px;
opacity: .6;
text-decoration: line-through;
}


.drzSlideCheckout-cart-itemLast {
.drzSlideCheckout-cart-item;
background-color: @white;
Expand Down

0 comments on commit 34a9325

Please sign in to comment.