Forum Replies Created

Viewing 25 posts - 211 through 235 (of 235 total)
  • Author
    Posts
  • in reply to: Override Woocommerce form-shipping.php file #640872

    Well it worked with another theme which is older than yours. I guess that I should work somewhere on your config.php for woocommerce, but really don’t know where.

    It doesn’t matter. I will keep the modified files in a backup folder and when WC is updated I will substitute the new files with my custom files

    in reply to: Override Woocommerce form-shipping.php file #640855

    Yes I checked it out thank you. But that is not the case. My child theme works perfectly and my problem doesn’t relate to page templates or style sheet, but only to woocommerce files. I already managed with other themes to override woocommerce files by copying them in the child theme folder in the proper directory as reported in this post https://docs.woothemes.com/document/template-structure/

    Unfortunately this time it doesn’t work

    in reply to: Adding the stock quantity in a custom table #640754

    Sorry Ismael could you please hide the login details I sent to you? I wrongly forgot to write them as a private content

    Thank you

    in reply to: Adding the stock quantity in a custom table #640734

    Hi Ismael, here I am.

    To see how the code works please refer to the following link

    As I was telling you, the csr-expeditions is the product with the variations that correspond to different date cruises. I added also gravity form to allow the possibility of adding the names of the participants if they are > 1. Just below the form I added the calendar that I described above

    These where my steps:

    1) added the new shortcodes in the child theme folder
    2) added the new wc-class to the class-wc-product-variation.php file which STILL is in the woocommerce folder

    Actually my problem is where I can save the class-wc-product-variation.php file in my child theme in order to keep it even if I update woocommerce. I had the same issue with another file of woocommerce that I modified (the form-shipping.php) and it doesn’t work if saved in my child- theme folder.
    Do you have any suggestion?

    in reply to: Override Woocommerce form-shipping.php file #640722

    Hi Rikard, actually I still not solved the problem of woocommerce overriding. It seems that I should copy the WC modified files in my child theme folder, in a path like child-teme/woocommerce/templates/checkout, but it doesn’t work like that.

    I worked on modifying another file of woocommerce for my purposes (see wrong answer above) and still have the same problem…

    Elena

    in reply to: Adding the stock quantity in a custom table #640565

    Hi sorry, but while waiting for your answer I went thinking on about the solution and I imagine I got it! Since it may serve for others, I’d like to report here the procedure I adopted. Maybe you can also answer to a question (see at the bottom of the codes)

    First of all I created a new function on the file class-wc-product-variation.php that is found in woocommerce/includes/
    The function is more or less the modified copy of the get_formatted_name at line 741 of the file. My new function is called get_formatted_variations_name and returns a string which gives the title of the variation and the price. Here it is:

    STEP 1

    
    	/**
    	 * Get product variation name. Used within admin.
    	 *
    	 * @return string Formatted product name, including attributes and price
    	 */
    	public function get_formatted_variations_name() {
    		if ( $this->get_sku() ) {
    			$identifier = $this->get_sku();
    		} else {
    			$identifier = '';
    		}
    
    		$formatted_attributes = $this->get_formatted_variation_attributes( true );
    		$variation_name = substr($formatted_attributes, 27);
    		$extra_data           = $variation_name . ' – ' . wc_price( $this->get_price() );
    
    		return sprintf( __( '%s', 'woocommerce' ), $extra_data );
    	}
    

    STEP 2)
    I created a new avia element called “calendar’ in which I call the function stated before, together with the stock data in a loop, in order to extract all variation for a determined product. In my case the product was called “CSR Expeditions Payment” and the variations are the dates of the cruises. The $loop passes all the products, and before outputting the data I need, I filter the product of interest (in this case CSR Expeditions Payment).

     
    <?php
    if( !class_exists( 'woocommerce' ) )
    {
    	add_shortcode('csr_calendar_button', 'avia_please_install_woo');
    	return;
    }
    
    if ( !class_exists( 'avia_csr_calendar_button' ) )
    {
    	class avia_csr_calendar_button extends aviaShortcodeTemplate
    	{
    		/**
    		 * Create the config array for the shortcode button
    		 */
    		function shortcode_insert_button()
    		{
    			$this->config['name']		= __('CSR Calendar', 'avia_framework' );
    			$this->config['tab']		= __('Plugin Additions', 'avia_framework' );
    			$this->config['icon']		= AviaBuilder::$path['imagesURL']."sc-button.png";
    			$this->config['order']		= 23;
    			$this->config['target']		= 'avia-target-insert';
    			$this->config['shortcode'] 	= 'csr_calendar_button';
    			$this->config['tooltip'] 	= __('Display the "CSR Calnedar" button for the current product', 'avia_framework' );
    			$this->config['drag-level'] = 3;
    			$this->config['tinyMCE'] 	= array('disable' => "true");
    			$this->config['posttype'] 	= array('product',__('This element can only be used on single product pages','avia_framework'));
    		}
    
    		/**
    		 * Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
    		 * Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
    		 * Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
    		 *
    		 *
    		 * @param array $params this array holds the default values for $content and $args.
    		 * @return $params the return array usually holds an innerHtml key that holds item specific markup.
    		 */
    		function editor_element($params)
    		{
    			$params['innerHtml'] = "<img />config['icon']."' title='".$this->config['name']."' />";
    			$params['innerHtml'].= "<div class='avia-element-label'>".$this->config['name']."</div>";
    			$params['content'] 	 = NULL; //remove to allow content elements
    			return $params;
    		}
    
    		/**
    		 * Frontend Shortcode Handler
    		 *
    		 * @param array $atts array of attributes
    		 * @param string $content text within enclosing form of shortcode element
    		 * @param string $shortcodename the shortcode found, when == callback name
    		 * @return string $output returns the modified html string
    		 */
    		function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
    		{
    			$output = "";
    			$meta['el_class'];
    			
    			global $woocommerce, $product;
    			if(!is_object($woocommerce) || !is_object($woocommerce->query) || empty($product)) return;
    
    			// $product = wc_get_product();
    			
    			$output .= "<div class='av-woo-calendar-button ".$meta['el_class']."'>";
    			ob_start();?>
    			
                    <table cellspacing="0" cellpadding="2">
                        <thead>
                            <tr>
                                <th scope="col" style="text-align:left;"><?php _e('Cruise', 'woothemes'); ?></th>
                                <th scope="col" style="text-align:left;"><?php _e('Places availability', 'woothemes'); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php
                        
                        $args = array(
                            'post_type'			=> 'product_variation',
                            'post_status' 		=> 'publish',
                            'posts_per_page' 	=> -1,
                            'orderby'			=> 'title',
                            'order'				=> 'DESC',
                            'meta_query' => array(
                                array(
                                    'key' 		=> '_stock',
                                    'value' 	=> array('', false, null),
                                    'compare' 	=> 'NOT IN'
                                )
                            )
                        );
                        
                        $loop = new WP_Query( $args );
                    
                        while ( $loop->have_posts() ) : $loop->the_post();
                        
                                        $product = new WC_Product_Variation( $loop->post->ID );
                                if (get_the_title( $loop->post->post_parent ) == 'CSR Expeditions Payment')
                                {		
                            ?>
                            <tr>
                                <td><?php  echo $product->get_formatted_variations_name(); ?></td>
                                <td><?php echo intval ($product->stock); ?></td>
                            </tr>
                            <?php
                                }
                        endwhile; 
                        
                        ?>
                        </tbody>
                    </table>
    		
    			<?php
    			
    			$output .= ob_get_clean();
    			$output .= "</div>";
    			
    			return $output;
    		}
    	}
    }
    

    CONSIDERATIONS

    1) It seems working by now, but I have to add it AFTER the product purchase button, otherwise the purchase button doesn’t appear… still have to figure out why

    2) I still am trying to see where I can save my new function in the child theme folde. I tried to add it to a subfolder woocommerce/includes, but it doesn’t work like that. By now I left the new function in the original woocommerce file class-wc-product-variation.php, but it is not a good solution as if I update the plugin the modifications would be lost. HERE’S MY QUESTION: do you know where I should save it??

    Thanks again
    Elena

    in reply to: Override Woocommerce form-shipping.php file #640564

    SORRY ANDY, I ANSWERED TO THE WRONG THREAD!!!! PLEASE DELETE MY ANSWER. I AM GOING TO PUBLISH IN THE PROPER ONE!!

    in reply to: Override Woocommerce form-shipping.php file #640559

    Hi Andy, I think I got it! Since it may serve for others I report here the procedure I adopted. Maybe you can also answer to a question (see at the bottom of the codes)

    First of all I created a new function on the file class-wc-product-variation.php that is found in woocommerce/includes/
    The function is more or less the modified copy of the get_formatted_name at line 741 of the file. My new function is called get_formatted_variations_name and returns a string which gives the title of the variation and the price. Here it is:

    STEP 1

    
    	/**
    	 * Get product variation name. Used within admin.
    	 *
    	 * @return string Formatted product name, including attributes and price
    	 */
    	public function get_formatted_variations_name() {
    		if ( $this->get_sku() ) {
    			$identifier = $this->get_sku();
    		} else {
    			$identifier = '';
    		}
    
    		$formatted_attributes = $this->get_formatted_variation_attributes( true );
    		$variation_name = substr($formatted_attributes, 27);
    		$extra_data           = $variation_name . ' &ndash; ' . wc_price( $this->get_price() );
    
    		return sprintf( __( '%s', 'woocommerce' ), $extra_data );
    	}
    

    STEP 2)
    I created a new avia element called “calendar’ in which I call the function stated before, together with the stock data in a loop, in order to extract all variation for a determined product. In my case the product was called “CSR Expeditions Payment” and the variations are the dates of the cruises. The $loop passes all the products, and before outputting the data I need, I filter the product of interest (in this case CSR Expeditions Payment).

     
    <?php
    if( !class_exists( 'woocommerce' ) )
    {
    	add_shortcode('csr_calendar_button', 'avia_please_install_woo');
    	return;
    }
    
    if ( !class_exists( 'avia_csr_calendar_button' ) )
    {
    	class avia_csr_calendar_button extends aviaShortcodeTemplate
    	{
    		/**
    		 * Create the config array for the shortcode button
    		 */
    		function shortcode_insert_button()
    		{
    			$this->config['name']		= __('CSR Calendar', 'avia_framework' );
    			$this->config['tab']		= __('Plugin Additions', 'avia_framework' );
    			$this->config['icon']		= AviaBuilder::$path['imagesURL']."sc-button.png";
    			$this->config['order']		= 23;
    			$this->config['target']		= 'avia-target-insert';
    			$this->config['shortcode'] 	= 'csr_calendar_button';
    			$this->config['tooltip'] 	= __('Display the "CSR Calnedar" button for the current product', 'avia_framework' );
    			$this->config['drag-level'] = 3;
    			$this->config['tinyMCE'] 	= array('disable' => "true");
    			$this->config['posttype'] 	= array('product',__('This element can only be used on single product pages','avia_framework'));
    		}
    
    		/**
    		 * Editor Element - this function defines the visual appearance of an element on the AviaBuilder Canvas
    		 * Most common usage is to define some markup in the $params['innerHtml'] which is then inserted into the drag and drop container
    		 * Less often used: $params['data'] to add data attributes, $params['class'] to modify the className
    		 *
    		 *
    		 * @param array $params this array holds the default values for $content and $args.
    		 * @return $params the return array usually holds an innerHtml key that holds item specific markup.
    		 */
    		function editor_element($params)
    		{
    			$params['innerHtml'] = "<img />config['icon']."' title='".$this->config['name']."' />";
    			$params['innerHtml'].= "<div class='avia-element-label'>".$this->config['name']."</div>";
    			$params['content'] 	 = NULL; //remove to allow content elements
    			return $params;
    		}
    
    		/**
    		 * Frontend Shortcode Handler
    		 *
    		 * @param array $atts array of attributes
    		 * @param string $content text within enclosing form of shortcode element
    		 * @param string $shortcodename the shortcode found, when == callback name
    		 * @return string $output returns the modified html string
    		 */
    		function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
    		{
    			$output = "";
    			$meta['el_class'];
    			
    			global $woocommerce, $product;
    			if(!is_object($woocommerce) || !is_object($woocommerce->query) || empty($product)) return;
    
    			// $product = wc_get_product();
    			
    			$output .= "<div class='av-woo-calendar-button ".$meta['el_class']."'>";
    			ob_start();?>
    			
                    <table cellspacing="0" cellpadding="2">
                        <thead>
                            <tr>
                                <th scope="col" style="text-align:left;"><?php _e('Cruise', 'woothemes'); ?></th>
                                <th scope="col" style="text-align:left;"><?php _e('Places availability', 'woothemes'); ?></th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php
                        
                        $args = array(
                            'post_type'			=> 'product_variation',
                            'post_status' 		=> 'publish',
                            'posts_per_page' 	=> -1,
                            'orderby'			=> 'title',
                            'order'				=> 'DESC',
                            'meta_query' => array(
                                array(
                                    'key' 		=> '_stock',
                                    'value' 	=> array('', false, null),
                                    'compare' 	=> 'NOT IN'
                                )
                            )
                        );
                        
                        $loop = new WP_Query( $args );
                    
                        while ( $loop->have_posts() ) : $loop->the_post();
                        
                                        $product = new WC_Product_Variation( $loop->post->ID );
                                if (get_the_title( $loop->post->post_parent ) == 'CSR Expeditions Payment')
                                {		
                            ?>
                            <tr>
                                <td><?php  echo $product->get_formatted_variations_name(); ?></td>
                                <td><?php echo intval ($product->stock); ?></td>
                            </tr>
                            <?php
                                }
                        endwhile; 
                        
                        ?>
                        </tbody>
                    </table>
    		
    			<?php
    			
    			$output .= ob_get_clean();
    			$output .= "</div>";
    			
    			return $output;
    		}
    	}
    }
    

    CONSIDERATIONS

    1) It seems working by now, but I have to add it AFTER the product purchase button, otherwise the purchase button doesn’t appear… still have to figure out why

    2) I still am trying to see where I can save my new function in the child theme folde. I tried to add it to a subfolder woocommerce/includes, but it doesn’t work like that. By now I left the new function in the original woocommerce file class-wc-product-variation.php, but it is not a good solution as if I update the plugin the modifications would be lost. HERE’S MY QUESTION: do you know where I should save it??

    Thanks again
    Elena

    • This reply was modified 8 years, 5 months ago by elenapoliti.
    in reply to: Override Woocommerce form-shipping.php file #639700

    Hi Basilis, I tried, but it doesn’t work in the front-end. It only works it it stays in woocommerce original folder.

    in reply to: Override Woocommerce form-shipping.php file #639684

    Right now I solved it by changing the file shipping-form in woocommerce>templates>checkout at line 40

    from

    <label for=”ship-to-different-address-checkbox” class=”checkbox”><?php _e( ‘Shipping to a different address?’, ‘woocommerce’ );

    to
    <label for=”ship-to-different-address-checkbox” class=”checkbox”><?php _e( ‘Are you buying it for somebody else?’, ‘woocommerce’ );

    But it will be deleted once the I update the WC

    Thanks anyway

    in reply to: Managing text caption on images in responsive mode #635046

    Thank you very much: that worked perfectly!

    You can close the topic now.

    My compliments for your incredible theme!
    Elena

    in reply to: Managing text caption on images in responsive mode #634616

    Thank you very much: that worked! However I am using a child theme. If I add your code to my own style.css (which would be very much preferable), it doesn’t. I have to add the code #top, but then the text caption appears on any screen size Do you have any suggestion?

    in reply to: Managing text caption on images in responsive mode #634368

    Hi Rikard, did you have the chance to see the link I sent to you? Thanks

    Elena

    in reply to: Managing text caption on images in responsive mode #633548

    I imagined it was hard, as it doesn’t seem to be controlled by CSS classes. However please give a look to this page

    The first two images have a text caption that displays on hover. However the text doesn’t appear on a mobile device with the touch screen. Hence I would like that on touch screens the text will be displayed always.

    Best regards

    Elena

    in reply to: widget latest portfolio shown as a horizontal list #629799

    Ok, I found the solution. In order to scroll down the various element of the full-width submenu in a responsive mode I added this CSS
    @media only screen and (max-width: 767px) {
    .responsive #top .av-menu-mobile-active .av-open-submenu.av-subnav-menu {
    display: block;
    position:relative;
    height: auto;
    max-height: 200px;
    overflow-x: hidden;
    }
    }

    In this way you can se part of the submenu and still part of the page beneath it. Then I worked a little bit on the color change of the text when on hover and it works finely.

    Maybe this could be helpful for others! You can check the topic as closed
    Thanks

    in reply to: widget latest portfolio shown as a horizontal list #629773

    Hi Ismael, excuse my delay. You don’t find it because at the end I solved the problem by using a full-width submenu avia element that worked perfectly. I have an issue anyway concerning the full-width submenu aspect when it is in responsive mode. If I have many voices in the menu, in responsive mode it appears vertically, but I cannot scroll down all the voices. Is there a way to make it scrollable?

    Thanks a lot

    Elena

    in reply to: widget latest portfolio shown as a horizontal list #628183

    Hi Rikard have you had the chance to give a look to my link? Do you have any suggestion?

    Thank you very much

    Elena

    in reply to: widget latest portfolio shown as a horizontal list #626983

    Hi Rikard, thank for your reply. Here’s an example

    I’d like to have the widget “porva” list horizontally displayed and centered ( I have to take the date off, but I found an old post about how to do it!)

    Cheers

    in reply to: Customize categories widget in area widget #618166

    Never mind: I figured it out. I use the masonry and add the blog categories!

    However I have now this question.
    In my masonry I have the category filter and the image, tittle, short excerpt and date of the post are visualized. However I would like to do the following:

    1) increase the excerpt (make it slightly longer)
    2) showing between the title and the excerpt also the category name

    I found an old post about this issue (https://kriesi.at/support/topic/displaying-category-title-on-post-description/) but it seems referring to the old versions of Enfold. I don’t find infact the reference code in the masonry-entries.php file and wouldn’t like to mess everything up!

    Thanks

    Elena

    • This reply was modified 8 years, 7 months ago by elenapoliti.
    in reply to: Create a static oblique div with Layer Slider #608772

    Dear Vinnie, thanks for the suggestion, but I know how to write the css in order to have a skewed container. The problem is that som sort of custom CSS are not detected by Layer Slider in the front-end, although you can see it in the backend. For example, if I give some shade to my layers via custom CSS, that would work, but not the skeweness. I’ve read something about this issue, but I was wondering if you at Kriesi have found some solutions.

    Best

    Elena

    in reply to: Create a static oblique div with Layer Slider #608245

    Thanks Vinnie, but my problem is not the overlay. It is how to create a white div as an oblique ribbon. I used the rotate css property, but it works only in the building section: when I try to see it online it doesn’t work and the div is vertical.
    Thans very much
    Elena

    in reply to: Post extract doesn't appear in av-magazine-content #525712

    Thanks Ismael, I got it!

    in reply to: Post extract doesn't appear in av-magazine-content #524769

    Thanks Ismael, I missed that step! And what about the option of having a filter for articles in the upper right corner (see images as I posted on dropbox)? Did I do something wrong with the categories? Or should I add a specific element?

    Thanks

    • This reply was modified 9 years, 1 month ago by elenapoliti.
    in reply to: Post extract doesn't appear in av-magazine-content #523893

    Here the link to dropbox

    https://dl.dropboxusercontent.com/u/2911029/Enfold.zip

    You find the image of my homepage and the image of the Enfold demo, with the highlighted problems

    Thanks

    in reply to: Post extract doesn't appear in av-magazine-content #523228

    Hi Elliott, thanks for answering back so quickly! As the website is on a “coming soon” mode, you won’t see it unless you get logged in.

    I’m gonna give you the credentials in the private section, so that you can see which are my problems (actually I don’t see any tab in the magazine element that allows to show the selection among categories as displayed in the dem i.e. All>News>Cat X).

    The problem is in the home page (actually is the only that I created up to now).

Viewing 25 posts - 211 through 235 (of 235 total)