Skip to content

Commit

Permalink
fix: tiny fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lastofpudge committed Feb 27, 2024
1 parent a895767 commit 9eb6cf5
Show file tree
Hide file tree
Showing 121 changed files with 47 additions and 19 deletions.
6 changes: 5 additions & 1 deletion resources/assets/dist/js/app.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ __webpack_require__.r(__webpack_exports__);
function initQuantity() {
var qtyButton = document.querySelector('.js-product-qty');
var cartButton = document.querySelector('.js-add-to-cart');
if (cartButton) {
if (qtyButton && cartButton) {
qtyButton.addEventListener('change', function (event) {
cartButton.dataset.quantity = event.target.value;
});
Expand Down Expand Up @@ -493,6 +493,7 @@ __webpack_require__.r(__webpack_exports__);
function initRangeSlider() {
var nonLinearStepSlider = document.getElementById('rangeSlider');
if (nonLinearStepSlider) {
var nonLinearStepSliderValueElement = document.getElementById('slider-non-linear-step-value');
var slider = nouislider__WEBPACK_IMPORTED_MODULE_0__["default"].create(nonLinearStepSlider, {
start: [0, 100],
connect: true,
Expand All @@ -501,6 +502,9 @@ function initRangeSlider() {
max: 100
}
});
nonLinearStepSlider.noUiSlider.on('update', function (values) {
nonLinearStepSliderValueElement.innerHTML = values.join(' - ');
});
var valueElement = document.getElementById('slider-non-linear-step-value');
var urlParams = new URLSearchParams(window.location.search);
var setSliderValues = function setSliderValues(values) {
Expand Down
2 changes: 1 addition & 1 deletion resources/assets/src/scripts/cart/quantity.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function initQuantity() {
const qtyButton = document.querySelector('.js-product-qty')
const cartButton = document.querySelector('.js-add-to-cart')

if (cartButton) {
if (qtyButton && cartButton) {
qtyButton.addEventListener('change', event => {
cartButton.dataset.quantity = event.target.value
})
Expand Down
6 changes: 6 additions & 0 deletions resources/assets/src/scripts/rangeSlider.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export function initRangeSlider() {
const nonLinearStepSlider = document.getElementById('rangeSlider')

if (nonLinearStepSlider) {
const nonLinearStepSliderValueElement = document.getElementById('slider-non-linear-step-value')

const slider = noUiSlider.create(nonLinearStepSlider, {
start: [0, 100],
connect: true,
Expand All @@ -13,6 +15,10 @@ export function initRangeSlider() {
}
})

nonLinearStepSlider.noUiSlider.on('update', function (values) {
nonLinearStepSliderValueElement.innerHTML = values.join(' - ')
})

const valueElement = document.getElementById('slider-non-linear-step-value')
const urlParams = new URLSearchParams(window.location.search)

Expand Down
8 changes: 0 additions & 8 deletions resources/views/woocommerce/cart.twig
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,6 @@
<span class="woocommerce-Price-currencySymbol">{{ currency_symbol }}</span>
</td>
</tr>
<tr>
<td colspan="4" class="text-end"><strong>Eco Tax (-2.00)</strong></td>
<td class="text-end">$4.00</td>
</tr>
<tr>
<td colspan="4" class="text-end"><strong>VAT (20%)</strong></td>
<td class="text-end">$49.60</td>
</tr>
<tr>
<td colspan="4" class="text-end"><strong>Total</strong></td>
<td class="text-end">
Expand Down
7 changes: 5 additions & 2 deletions resources/views/woocommerce/components/cartSmall.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@
{% if cart_item['data']._sale_price is not empty %}
<td>x{{ cart_item['quantity'] }}</td>
<td class="text-end">
<s>{{ fn('wc_price', cart_item['data']._regular_price) }}</s> {{ fn('wc_price', cart_item['data']._sale_price) }}
<s>{{ fn('wc_price', cart_item['data']._regular_price) }}</s>
{{ fn('apply_filters', 'woocommerce_cart_item_price', cart.get_product_price(_product), cart_item, cart_item_key) }}
</td>
{% else %}
<td>x{{ cart_item['quantity'] }}</td>
<td class="text-end">{{ fn('wc_price', cart_item['data']._regular_price) }}</td>
<td class="text-end">
{{ fn('apply_filters', 'woocommerce_cart_item_price', cart.get_product_price(_product), cart_item, cart_item_key) }}
</td>
{% endif %}

<td class="text-end">
Expand Down
4 changes: 3 additions & 1 deletion resources/views/woocommerce/product.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
</div>
<div class="row">
<div class="col-6">
{% do action('woocommerce_before_single_product_summary') %}
<div class="position-relative">
{% do action('woocommerce_before_single_product_summary') %}
</div>
</div>

<div class="col-6">
Expand Down
21 changes: 21 additions & 0 deletions resources/views/woocommerce/shop.twig
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
</div>

<div class="col-10">
<div class="row">
<div class="float-right">
{{ fn('woocommerce_catalog_ordering') }}
</div>
</div>
<div class="row">
{% if posts %}
{% for post in posts %}
Expand All @@ -51,6 +56,22 @@
<img src="{{ theme.path }}/resources/assets/dist/images/placeholders/no-image-default.png"
alt="" />
{% endif %}

{% if post.is_type('variable') %}
<p>This is a variable product.</p>
{% else %}
<p>This is not a variable product.</p>
{% endif %}

<div class="mt-2">
<button class="btn btn-primary js-add-to-cart" data-quantity="1"
data-product_id="{{ post.id }}"
{% if post.is_type('variable') %} disabled {% endif %}
>
Add to
Cart
</button>
</div>
</div>
</div>
{% endfor %}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
echo wc_get_email_order_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
$order,
array(
'show_sku' => $sent_to_admin,
'show_image' => false,
'image_size' => array( 32, 32 ),
'plain_text' => $plain_text,
'sent_to_admin' => $sent_to_admin,
)
'show_sku' => $sent_to_admin,
'show_image' => false,
'image_size' => array( 32, 32 ),
'plain_text' => $plain_text,
'sent_to_admin' => $sent_to_admin,
)
);
?>
</tbody>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 9eb6cf5

Please sign in to comment.