swissup/module-breeze-amasty-stockstatus

Custom Stock Status by Amasty Breeze Frontend Integration

Installs: 129

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 1

Language:JavaScript

Type:magento2-module

1.0.0 2023-09-04 14:53 UTC

This package is auto-updated.

Last update: 2024-11-11 07:03:17 UTC


README

Required patches

vendor/amasty/stockstatus/view/frontend/web/js/amstockstatus.js

Find the code in the _reloadContent method:

    this.nodes.spanElement.replaceWith(this.options[key]['custom_status']);

and add the following line after it:

    this.nodes.spanElement = $(this.selectors.stock).first();

Find the code:

this.nodes.stockAlertElement = $('<div>', {
    class: this.classes.stockAlert,
    'data-amstock-js': 'alert',
    title: $t('Subscribe to back in stock notification'),
    rel: 'external'
});

and replace it with:

this.nodes.stockAlertElement = $('<div>')
    .addClass(this.classes.stockAlert)
    .attr('data-amstock-js', 'alert')
    .attr('title', $t('Subscribe to back in stock notification'))
    .attr('rel', 'external');

Installation

composer require swissup/module-breeze-amasty-stockstatus
bin/magento setup:upgrade --safe-mode=1