magento2 – Overrides the mini cart icon less in custom design

I created a custom theme that overrides a luma. I've placed the following less in _extend.less, but there is no effect. Vendor default web css source_extend.less

.icons-font-list {
    list-style: none;
    padding: 0;
    li {
        float: left;
        width: 25%;
        margin-bottom: 35px;
        text-align: center;
        > span {
            .lib-icon-font('', @_icon-font-size: 34px);
            &:before {
                content: attr(data-icon);
                margin: 0 auto;
                display: block;
                border-style: solid;
            }
        }
    }

}}

Original frontend CSS:

.minicart-wrapper .action.showcart:before {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 22px;
    line-height: 28px;
    color: #757575;
    content: 'e611';
    font-family: 'luma-icons';
    margin: 0;
    vertical-align: top;
    display: inline-block;
    font-weight: normal;
    overflow: hidden;
    speak: none;
    text-align: center;
}

cart – Magento 1.9 I have to add the quantity in the category page

My template used Ajax map
this code in my category page (list.phtml)


getAddToCartUrl($_product) ?>javascript:void(0)" class="addtocart" title="__('Add to Cart') ?>" 
onclick="setLocationAjax(this,'getAddToCartUrl($_product) ?>'
,'getId(); ?>')"onclick="document.getElementById('addtocart_form_getId(); ?>').submit()"> __('Add to Cart') ?>

A number is added when the user clicks Add to Map
I need the user to be able to enter the number of product needs on this page
naturally by entering a number

Filter – Remove the add to cart icon

I'm trying to remove a button that appears when you hover over the images in a Woocommerce shop. (See the pictures below)
Icon that is displayed
The product is a variable product.

If I can't do this, I also tried formatting it to be a normal product view button using the code below. However, I have problems with how I can format it otherwise.
Any help much appreciated.

// Change button text on WooCommerce Shop pages
add_filter( 'woocommerce_product_add_to_cart_text', 'woocustomizer_edit_shop_button_text' );

function woocustomizer_edit_shop_button_text() {
    global $product;
    $product_type = $product->get_type(); // Get the Product Type

    // Change text depending on Product type
    switch ( $product_type ) {
        case "variable":
            return __( '£', 'woocommerce' );
            break;
        case "grouped":
            return __( 'View All Products', 'woocommerce' );
            break;
        case "external":
            // Button label is added when editing the product
            return esc_html( $product->get_button_text() );
            break;
        default:
            return __( 'Buy Now', 'woocommerce' );
    }
}

Exclusive Ala Cart bare metal servers: create your own server at wholesale prices Proxies-free

Create your own server: (BUILD YOUR OWN SERVER)

Introduction of the BYOS ordering system (Build Your Own Server) from H4Y !! H4Y Technologies (Host4Yourself.com and iWebFusion.net) has been known for its unique and custom product and server options for almost 20 years. "If it can be built, we can build it" was our motto. Whether you need a self-managed infrastructure or our famous "meticulous management", H4Y is all about options. Control panel options. Datacenter options. Bandwidth options. CPU / memory / RAM / hard disk / RAID / OS / etc, etc Options Options Options!

BUILD YOUR OWN SERVER NOW: https://byos.h4y.us

FAQ:

Most hosts offer many options. What does it do differently?

We have bothered to provide a wide range of options and they all fit together like peas and carrots! Maybe the competition doesn't have the resources to offer SO MANY options. Maybe you don't have time to keep up with the thousands of hardware combinations our customers and resellers want. Do you need NVMe? NVMe hard drives are only possible with certain configurations. Do you need 12 drives and 1 TB RAM? This is only possible with a certain chassis. We have endeavored to retain a wide range of hardware and configuration options that you can choose from, including cheap wholesale prices. Your application may require a quad CPU computer with a single small drive and little RAM, or your budget may require servers under $ 100 with 8 cores and lots of RAM. From one extreme to the other and everywhere in between – choose your taste at https://byos.h4y.us.

What is the deployment time?

We may live in a world of instant gratification, but please give us some time to prepare your bespoke server. While servers are often in stock and provisioned on the same day, we deliver, build and burn test servers as needed. So we can afford to maintain such a large selection with limited risk. After all, we have been there since 2001 and want to stay !!

I do not see what I want !!?!

ASK US !! Simply contact us via our 24/7/365 live chat, telephone, email or help desk. We are happy to supply the desired hardware firewall model, a private switch or a state-of-the-art system that has just come onto the market. Yes, we offer Lease2Own. We can do anything.

Where are the servers located?

The data center locations include:

Monticello, IA – USSHC (http://lg.ia.h4y.us)
Charlotte, NC – SEGRA (http://lg.nc.h4y.us)
Bend, OR – Cascade Divide (http://lg.or.h4y.us)
Los Angeles, CA – Peer 1 (http://lg.ca.h4y.us)
Los Angeles, CA – Psychz (http://lg.ca2.h4y.us)

We have our own equipment, house staff, shipping notifications and Layer 3 networks. Large IP subnets available. We support your own IP announcements and BGP sessions!

########################################

Individual CPU servers – Bare metal from USD $ 52.50 / month
Example: E-2288G at only $ 100 / month!

Dual CPU budget server – Bare metal from USD $ 47 / month
Example: Dual E5-2630 @ only $ 62 / month!

Dual CPU Premium Server – Bare metal from USD $ 119 / month
Example: Dual E5-2690v3 at only $ 122.50 / month!

Quad CPU server – Bare metal from USD $ 149 / month
Example: Quad E5-4650v2 at only $ 214 / month

Create your server here: https://byos.h4y.us

##########################################

– –H4Y Technologies LLC (www.host4yourself.com & www.iwfhosting.net)
"Smarter, cheaper, faster" .. Since 2001!!
866-435-5642

Javascript – Shopping cart items show errors after adding a description field to content

I tried to find out why there is an error in my shopping cart, but apparently you cannot find it. The problem started when I added the content of the description field and a small change to my Js file.

Here is the link to the project on github http://elvin247.github.io

Here is my Js code:

// JavaScript document
const client = contentful.createClient ({
// This is the space ID. The content of a space is like a project folder
Space: "r742wojtl7kg",
// This is the access token for this area. You usually get both the ID and the token in the Contentful web application
Access token:
A8PNnqkBaRJN4TvjyNxDR0C0erFG9LgntCJ_0hL68jM
});

// variables
const cartBtn = document.querySelector (". cart-btn");
const closeCartBtn = document.querySelector (". close-cart");
const clearCartBtn = document.querySelector (". clear-cart");
const cartDOM = document.querySelector (". cart");
const cartOverlay = document.querySelector (". cart-overlay");
const cartItems = document.querySelector (". cart-items");
const cartTotal = document.querySelector (". cart-total");
const cartContent = document.querySelector (". cart-content");
const productsDOM = document.querySelector (". products-center");
let cart = ();
let buttonDOM = ();
// syntactic sugar of the writing constructor function

// Products
Class products {
async getProducts () {
// always returns a promise so we can add .then
// We can use wait until the promise is fulfilled and return the result
To attempt {
// let result = wait for fetch ("products.json");
// leave data = wait for result.json ();
let contentful = wait for client.getEntries ({
content_type: "reejuviProducts"
});
console.log (contentful.items);

  let products = contentful.items;
  products = products.map(item => {
     const { title, price, description } = item.fields;
    const { id } = item.sys;
    const image = item.fields.image.fields.file.url;
   return { title, price, description, image };
  });

  return products;
} catch (error) {
  console.log(error);
}

}}
}}

// ui
Class UI {
displayProducts (products) {
let result = "";
products.forEach (product => {
Result + =

product

$ {product.title}

$ {product.description}

& # 8358; $ {product.price}


;;
});
productsDOM.innerHTML = result;
}}
getBagButtons () {
let button = (… document.querySelectorAll (". bag-btn"));
buttonDOM = buttons;
button.forEach (button => {
let id = button.dataset.id;
let inCart = cart.find (item => item.id === id);

  if (inCart) {
    button.innerText = "In Cart";
    button.disabled = true;
  }
  button.addEventListener("click", event => {
    // disable button
    event.target.innerText = "In Cart";
    event.target.disabled = true;
    // add to cart
    let cartItem = { ...Storage.getProduct(id), amount: 1 };
    cart = (...cart, cartItem);
    Storage.saveCart(cart);
    // add to DOM
    this.setCartValues(cart);
    this.addCartItem(cartItem);

// this.showCart ();
});
});
}}
setCartValues ​​(shopping cart) {
let tempTotal = 0;
let itemsTotal = 0;
cart.map (item => {
tempTotal + = item.price * item.amount;
itemsTotal + = item.amount;
});
cartTotal.innerText = parseFloat (tempTotal.toFixed (2));
cartItems.innerText = itemsTotal;
}}

addCartItem (item) {
const div = document.createElement ("div");
div.classList.add ("shopping cart");
div.innerHTML = `

$ {item.title}
₦ $ {item.price}
remove

      
`;
cartContent.appendChild(div);

}}
showCart () {
cartOverlay.classList.add ("transparentBcg");
cartDOM.classList.add ("showCart");
}}
setupAPP () {
cart = Storage.getCart ();
this.setCartValues ​​(cart);
this.populateCart (shopping cart);
cartBtn.addEventListener ("click", this.showCart);
closeCartBtn.addEventListener ("click", this.hideCart);
}}
populateCart (shopping cart) {
cart.forEach (item => this.addCartItem (item));
}}
hideCart () {
cartOverlay.classList.remove ("transparentBcg");
cartDOM.classList.remove ("showCart");
}}
cartLogic () {
clearCartBtn.addEventListener ("click", () => {
this.clearCart ();
});
cartContent.addEventListener ("click", event => {
if (event.target.classList.contains ("remove-item")) {
let removeItem = event.target;
let id = removeItem.dataset.id;
cartContent.removeChild (removeItem.parentElement.parentElement);
// remove item
this.removeItem (id);
} else if (event.target.classList.contains ("fa-chevron-up")) {
let addAmount = event.target;
let id = addAmount.dataset.id;
let tempItem = cart.find (item => item.id === id);
tempItem.amount = tempItem.amount + 1;
Storage.saveCart (shopping cart);
this.setCartValues ​​(cart);
addAmount.nextElementSibling.innerText = tempItem.amount;
} else if (event.target.classList.contains ("fa-chevron-down")) {
let lowerAmount = event.target;
let id = lowerAmount.dataset.id;
let tempItem = cart.find (item => item.id === id);
tempItem.amount = tempItem.amount – 1;
if (tempItem.amount> 0) {
Storage.saveCart (shopping cart);
this.setCartValues ​​(cart);
lowerAmount.previousElementSibling.innerText = tempItem.amount;
} else {
cartContent.removeChild (lowerAmount.parentElement.parentElement);
this.removeItem (id);
}}
}}
});
}}
clearCart () {
// console.log (this);
let cartItems = cart.map (item => item.id);
cartItems.forEach (id => this.removeItem (id));
while (cartContent.children.length> 0) {
cartContent.removeChild (cartContent.children (0));
}}
this.hideCart ();
}}
removeItem (id) {
cart = cart.filter (item => item.id! == id);
this.setCartValues ​​(cart);
Storage.saveCart (shopping cart);
let button = this.getSingleButton (id);
button.disabled = false;
button.innerHTML = add to cart;;
}}
getSingleButton (id) {
return buttonDOM.find (button => button.dataset.id === id);
}}
}}

Class memory {
static saveProducts (products) {
localStorage.setItem ("Products", JSON.stringify (Products));
}}
static getProduct (id) {
let products = JSON.parse (localStorage.getItem ("products"));
return products.find (product => product.id === id);
}}
static saveCart (shopping cart) {
localStorage.setItem ("cart", JSON.stringify (cart));
}}
static getCart () {
return localStorage.getItem ("cart")
? JSON.parse (localStorage.getItem ("cart"))
: ();
}}
}}

document.addEventListener ("DOMContentLoaded", () => {
const ui = new user interface ();
const products = new products ();
ui.setupAPP ();

// get all products
Products
.getProducts ()
.then (products => {
ui.displayProducts (products);
Storage.saveProducts (products);
})
.then (() => {
ui.getBagButtons ();
ui.cartLogic ();
});
});

Mini shopping cart – add the regular price with special price for mini cart and order overview (checkout page) – Magento 2.2.9

I am trying to have a regular price in addition to a special price on the minicart and checkout page. I added it on the cart page thanks to this topic:

Magento 2: How are the special price and regular price displayed on the shopping cart page?

But my tests to add it on the mini cart and checkout page are not good yet. Can you help me ?

For the minicart I tried changing sidebar.html to Magento_Wee with this code, but it didn't work:

getProduct()->getFinalPrice();
$normalPrice = $item->getProduct()->getPrice();
if ($block->displayPriceWithWeeeDetails()): ?>
        
    
        
    
        formatPrice($block->getUnitDisplayPriceExclTax()); ?> 
        

    
    
            formatPrice($normalPrice); ?>
    
    

Algorithms – Shopping cart offers

I've been wondering about this problem for some time. I find it interesting and couldn't find a solution.

This has to be seen in the context of a shopping cart in which you can first put 1 gold bar in your shopping cart and then add another 2 so that the total is 3.

Let's say we have these products:

1 gold bar = $ 40
2 gold bars = $ 80
3 gold bars = $ 110

So if I add 1 gold bar, my cart will be worth $ 40. If you add another 2, my cart will be worth $ 120.

Now I have 3 gold bars in my car.

But there is a price for 3 gold bars at $ 110, and I want this price to go up, of course, since I have 3 gold bars in my shopping cart.

Can this be classified as a normal backpack problem? Or is there another way of looking at it?

Thank you very much

magento 1.9 – The shopping cart rule does not apply if the condition applies to a custom shipping method

Where am I struggling with a problem, I create a custom shipping module based on this Envato Tutorial URL

The problem is that when I create a cart rule and choose one of the conditions my custom shipping method, the coupon that does not work, I try to call the method in my carrier class request->getFreeShipping() of the shipping module, but I always go wrong, the extension works well, if I remove the condition of the specific custom shipping method, the method will come true.

My code:

config.xml



    
        
            1.0
        
    
    
        
            
                Envato_Customshippingmethod_Model
            
        
        
            
                Envato_Customshippingmethod_Helper
            
        
    
    
        
            
                1
                1
                envato_customshippingmethod/demo
                Demo Shipping Method One
                10.00
                Demo Shipping Method
            
        
    

system.xml



    
        
            
                
                    
                    1
                    1
                    0
                    0
                    
                        
                            
                            select
                            adminhtml/system_config_source_yesno
                            1
                            1
                            0
                            0
                        
                        
                            <label>Shipping Method Name</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>20</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>0</show_in_website>
                            <show_in_store>0</show_in_store>
                        
                        
                            
                            select
                            shipping-applicable-country
                            adminhtml/system_config_source_shipping_allspecificcountries
                            30
                            1
                            0
                            0
                        
                        
                            
                            multiselect
                            31
                            adminhtml/system_config_source_country
                            1
                            0
                            0
                            1
                        
                    
                
            
        
    

Demo.php

getFreeShipping());die;
        $result = Mage::getModel('shipping/rate_result');
        $result->append($this->_getDefaultRate());

        return $result;
    }

    public function getAllowedMethods()
    {
        return array(
            'envato_customshippingmethod' => $this->getConfigData('name'),
        );
    }

    protected function _getDefaultRate()
    {
        $rate = Mage::getModel('shipping/rate_result_method');

        $rate->setCarrier($this->_code);
        $rate->setCarrierTitle($this->getConfigData('title'));
        $rate->setMethod($this->_code);
        $rate->setMethodTitle($this->getConfigData('name'));
        $rate->setPrice($this->getConfigData('price'));
        $rate->setCost(0);

        return $rate;
    }
}

The shopping cart rule that I do not post the picture because it works perfectly only stops working if I add the condition for a certain shipping method.

Note: I use Magento ver. 1.9.3.2

Many thanks for the help.