Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @computersimulatorscom,

    I want to confirm this works for me as well.

    In the spanish market we have different currencies that use the $ symbol, and even so the US dollar is present on the woocommerce list this can bring confusion to customers according to where they are in Latin America, so the need to have the $ symbol preceeded by ‘US’ is crucial.

    Here is my code for it. I encounterd issues trying to name in spanish the custom currency because in spanish ‘Dollar’ is written ‘Dólar’ with an accent. I corrected this by simply naming it in english.

    /**
     * Custom USD currency and USD currency symbol
     */
    add_filter( 'woocommerce_currencies', 'add_my_currency',20,1 );
    
    function add_my_currency( $currencies ) {
    
    	$currencies['ABC'] = __( 'US Dollar', 'woocommerce' ); /*Do not include accents in the name, eg.: dólar. This will generate an error without explanation */
         return $currencies;
    
    }
    
    add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 20, 2);
    
    function add_my_currency_symbol( $currency_symbol, $currency ) {
    
         switch( $currency ) {
    
         case 'ABC': $currency_symbol = 'US$'; 
         break;
    
         }
    
         return $currency_symbol;
    
    }
    

    Cheers

    Hi @alphoenix ,

    Actually if you try to edit with Elementor or use a page created with it for your shop page, this will create an error. “Sorry, the content area was not found in your page. You must call the_content function in the current template, in order for Elementor to work on this page.”.

    Bottom line being, don’t create a new page but create a Template that then you apply to your desired page…

    1. Go to Template
    2. Create new Product Archive or Single Page (customize as needed).
    3. Publish | On the Conditions of this template include “Shop Page” |

    Hope this helps,
    Cheers!

    Thread Starter d3venthusiastic

    (@d3venthusiastic)

    Hi @ryanr14

    Thanks for your input, I managed to get the desired outcome, more or less doing what you explained. Here’s the result: https://imgur.com/2Bar6aO

    So for anyone trying to accomplish this I figured I’ll share both functions.php and style.css codes for these. Take note that this changes are made on the Child Themes’ files and not on the Parent Theme.

    functions.php

    add_action('init','delay_remove');
    function delay_remove(){
    	remove_action('woocommerce_after_shop_loop','woocommerce_catalog_ordering', 10);
    	remove_action('woocommerce_before_shop_loop','woocommerce_catalog_ordering', 10);
    	remove_action( 'storefront_header', 'storefront_secondary_navigation', 30 );
    	remove_action( 'storefront_header', 'storefront_primary_navigation', 50 );
    	add_action( 'storefront_header', 'storefront_primary_navigation', 30 );
    		if ( function_exists( 'storefront_header_cart' ) ) {
    			remove_action( 'storefront_header', 'storefront_header_cart', 60 );
    			if ( function_exists( 'Storefront_WooCommerce_Customiser' ) ) {
    				$header_cart = get_theme_mod( 'swc_header_cart' );
    				if ( false == $header_cart ) {
    					// don't add back the cart
    				} else {
    					add_action( 'storefront_header', 'storefront_header_cart', 35 );
    				}
    				} else {
    					add_action( 'storefront_header', 'storefront_header_cart', 35 );
    					}
    				}

    style.css

    /* This allows to properly display the header items on a single line, but only if the proper actions are implemented on the functions file of the child theme */ 
    @media (min-width: 768px) {
    	#masthead .col-full {
    		display: flex;
    		align-items: center;
    		height: 60px;
    	}
    	#masthead .main-navigation {
    		text-align: right;
        		text-transform: uppercase;
    		font-size: 11px;
    		font-weight: 700;
    		/*letter-spacing: 2px;
    		word-wrap: break-word;*/
    		height: 50px;
    		margin-left: -2em;
    		/*width: 47%;*/
    	}
    	.woocommerce-active .site-header div.site-branding {
    		width: auto;
    	}
    }
    
    /* Masthead */
    #masthead.site-header {
    	height: 60px;
    	margin-bottom:50px;
    	padding-top:0px;
    	border-bottom:none;
    }
    
    /* Header area */
    .site-header .custom-logo-link img, .site-header .site-logo-anchor img, .site-header .site-logo-link img {
    margin-bottom: -25px;
    }
    
    /* This makes the header transparent so that the background image shows through*/ 
    .site-header {
    	background-color:transparent;
    }
    
    /* This limits the widht of the logo image */
    .site-header .site-branding img {
        height: auto;
        max-width: 190px;
        max-height: none;
    }
    
    /* This determines the main navigation menu looks, here used to determine the space between the top of the page and the menu items, margin-top as well as the margin of the mobile menu*/
    .main-navigation ul.menu, .main-navigation ul.nav-menu {
        max-height: none;
        overflow: visible;
        margin-top: 5px;
        margin-left: 0.1em;
        -webkit-transition: none;
        transition: none;
    }
    
    /* This sets the color of background menu categories and marging for handheld devices */
    .handheld-navigation ul.menu li {
    	background-color: #000c5b;
      	border-bottom: 1px solid white;
    	margin-top: 1px;
    }
    
    /* This sets the color of background menu categories and marging for handheld devices on hover mode*/
    .handheld-navigation  ul.menu li:hover {
    	background-color: #000c7c ;
    }
    
    /* This allows to control the space between the search box and the items surrounding it */ 
    .woocommerce-active .site-header .site-search {
        width: 21.7391304348%;
        float: right;
        margin-top: 20px;
        margin-left: 20px;
        clear: none;
    }
    
    /* This allows to control the space between the cart and its surroundings */ 
    .woocommerce-active .site-header .site-header-cart {
        width: 21.7391304348%;
        float: right;
        margin-top: 10px;
        margin-right: 0;
        margin-bottom: 0;
        font-size: 12px;
    
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)