Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thank you so much for the very quick and helpful change!

    B

    Would this work:

    if (isset($_POST[‘option_pass_ws’])){
    check_admin_referer(‘save_imac_settings’,’imacprestashop_save_settings’);
    $imacprestashop_options[‘option_url_ws’]=sanitize_text_field($_POST[‘option_url_ws’]);
    $imacprestashop_options[‘option_pass_ws’]=imacprestashop_encryption::encrypt($_POST[‘option_pass_ws’]);
    $imacprestashop_options[‘option_language_ws’]=sanitize_text_field($_POST[‘option_language_ws’]);
    $imacprestashop_options[‘show_language’]=sanitize_text_field($_POST[‘show_language’]);
    $imacprestashop_options[‘option_urlP_ws’]=sanitize_text_field($_POST[‘option_urlP_ws’]);
    $imacprestashop_options[‘option_products_ws’]=sanitize_text_field($_POST[‘option_products_ws’]);
    $imacprestashop_options[‘option_category_ws’]=sanitize_text_field($_POST[‘option_category_ws’]);
    $imacprestashop_options[‘option_nofollow_ws’]=0;
    if (isset($_POST[‘option_nofollow_ws’]))$imacprestashop_options[‘option_nofollow_ws’]=sanitize_text_field($_POST[‘option_nofollow_ws’]);
    $imacPrestashop_options[‘option_offers_ws’]=0;
    if (isset($_POST[‘option_offers_ws’]))$imacPrestashop_options[‘option_offers_ws’]=sanitize_text_field($_POST[‘option_offers_ws’]);
    update_option( ‘imacprestashop_options’, $imacprestashop_options );

    And for the check box:

    <tr valign=”top”>
    <th scope=”row”>
    <?php _e(“Hide Offers:”, “imacPrestashop”);?>
    </th>
    <td>
    <input type=”checkbox” name=”option_offers_ws” value=”1″ <?php checked( $imacPrestashop_options[‘option_offers_ws’], ‘1’ ); ?> />
    <?php _e(“<br>If the box is selected, special offer prices will not be displayed, only the full price of the products.”, “imacPrestashop”);?>
    </td>
    </tr>

    thanks for the quick reply..
    In the connect to database option there is a checkbox ‘hide offers’
    Is it possible to add this in the webservice connect option as well?

    Great – thank you it works!

    Theer is one other thing though… If you have an ‘expired ‘special price’ but have not deleted it when date expired, the product still shows the discount!

    Is there a conditional statement needed re reduction being acive or not somewhere?

    Thanks

    ukbaz

    (@ukbaz)

    Hi Francois

    Its The Euro format being hard coded into imacprestashop.php in th WordPress plugin
    The code used is as follows:
    if ($dto!=”){
    $precio_con_final=($precio_final-$dto);
    $txt_dto=number_format($dto, 2, ‘,’, ”).” €”;
    }
    As you can see above it places the Euro symbol after the numbers
    Rendering price of 25.99, € in Euros correctly
    But using £s
    The price displays as 25.99, £
    but should be £25.99

    Hope that clarifies

    Best regards

    Fixed now 🙂

    Hi Joe – thanks for that tried and tested and working fine!

    Quick question – I currently have the following code for Guest name (test box) and Menu Choice(select):

    function create_custom_fields( $array ) {
    	$array['guest_name_1'] = array( 
    		'title'             => 'Guest Name 1 ', 
    		'sanitize_callback' => 'custom_sanitize_callback', 
    		'display_callback'  => 'custom_display_callback',
    		'input_type'        => 'text',
    		'context'           => 'global', 
    		'required'          => 'true',
    	);
    
    	$array['menu_guest_1'] = array(
    		'title'             => 'Menu Guest 1',
    		'sanitize_callback' => 'custom_sanitize_callback',
    		'display_callback'  => 'custom_display_callback',
    		'input_type'        => 'select',
    		'input_values'      => array( 
    			'Standard Menu', 
    			'Vegetarian Menu',  
    		),
    		'context'           => 'global', 
    		'required'          => 'true',
    	);
    	$array['guest_name_2'] = array( 
    		'title'             => 'Guest Name 2', 
    		'sanitize_callback' => 'custom_sanitize_callback', 
    		'display_callback'  => 'custom_display_callback',
    		'input_type'        => 'text',
    		'context'           => 'global', 		
    	);
    
    	$array['menu_guest_2'] = array(
    		'title'             => 'Menu Guest 2',
    		'sanitize_callback' => 'custom_sanitize_callback',
    		'display_callback'  => 'custom_display_callback',
    		'input_type'        => 'select',
    		'input_values'      => array(
    			'', 
    			'Standard Menu', 
    			'Vegetarian Menu',  
    		),
    		'context'           => 'global', 		
    	);
    

    How can I change the above code to replace the select 3 options (blank, standard & vegetarian) with a single ‘vegetarian’ checkbox that would just display when checked?

    Thanks

    Baz

    Hi Joe
    Many thanks for the very quick response! I’ll keep an eye out for that update then. If you have time to give a quick ‘pointer’ to how it works, that would be great!

    Thanks again
    Baz

Viewing 8 replies - 1 through 8 (of 8 total)