• Hello,

    I use the beta plugin and I would like to know how to change the meta data on the ticket to have date and time in french? (delivrey date and time managed by plugin WOODT “ByC WooCommerce Order Delivery or Pickup with Date Time Location”)

    Sorry for my english, i’m french.

Viewing 7 replies - 1 through 7 (of 7 total)
  • in order-handler.php around line 190;

    function star_cloudprnt_create_receipt_order_meta_data($meta_data, $order, &$printer, $max_chars)
    	{
    		if(get_option('star-cloudprnt-print-order-meta-cb') != 'on')
    			return;
    		
    		// List of meta data item keys to print and formatted output
    		$fields = array(
    			"pi_delivery_date" => "Delivery Date: [value]",
    			"pi_delivery_time" => "Delivery Time: [value]",
    			"pi_delivery_type" => "Delivery Type: [value]"
    		);

    you can change Delivery Date/Date/Type:, like this:
    "pi_delivery_date" => "Date de livraison: [value]",

    • This reply was modified 3 years, 10 months ago by gendai. Reason: typo
    • This reply was modified 3 years, 10 months ago by gendai.
    Thread Starter studioleonard

    (@studioleonard)

    Thank you for the reply.

    I have :

    
    function star_cloudprnt_create_receipt_order_meta_data($meta_data, &$printer, $max_chars)
    	{
    		if(get_option('star-cloudprnt-print-order-meta-cb') != on)
    			return;
    		
    			// List of meta data item keys to print and formatted output
    		$fields = array(
    			"byconsolewooodt_delivery_date" => "Date de retrait: [value]",
    			"byconsolewooodt_delivery_time" => "Heure de retrait: [value]",
    			"byconsolewooodt_delivery_type" => "Delivery Type: [value]"
    		);
    		
    		$is_printed = false;
    		
    		foreach ($meta_data as $item_id => $meta_data_item)
    		{
    			if(! $is_printed)
    			{
    				$is_printed = true;
    				$printer->set_text_emphasized();
    				$printer->add_text_line("Informations relatives à la commande");
    				$printer->cancel_text_emphasized();
    			}
    			
    			$item_data = $meta_data_item->get_data();
    			$printer->add_text_line($item_data["key"].": ".$item_data["value"]);
    		}
    		
    		if($is_printed)	$printer->add_text_line("");
    	}
    

    But it don’t work i still have :

    Informations relatives à al commande
    byconsolewooodt_delivery_type: take away
    byconsolewooodt_delivery_date: 01/13/2021
    byconsolewooodt_delivery_time: 12:00 PM
    byconsolewooodt_delivery_date: 1

    How can i do to have this in french ? (text, local hour and time)

    • This reply was modified 3 years, 10 months ago by studioleonard.
    • This reply was modified 3 years, 10 months ago by Yui. Reason: please use CODE button for proper formatting

    If I’m correct the Time and Date format are used the from WP default, see https://www.ads-software.com/support/article/formatting-date-and-time/

    I have no idea why translation does not work, sorry. Could be that the ByConsile plugin uses other values.

    Perhaps @lawrenceowen can help out with this.

    Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @gendai thanks for helping out ??

    @studioleonard the advice that you have from @gendai is good, but based on a slightly different version of the plugin. You can get the version he is referring to from here.

    About the timezone and time/date formatting. The plugin here doesn’t modify those at all, it just prints the data stored by your WOODT plugin. Some extra code would be needed to adapt those. Could you please explain the issue with your time/date, is the formatting wrong or it is displaying the wrong time zone completely? Again, this will depend on your other plugin, but we can potentially correct it before printing.

    Thread Starter studioleonard

    (@studioleonard)

    I already use the beta version of the plugin. So the 1.2.0 beta version.

    About the time/date:
    it print : M/d/Y
    and i would like to have : d/M/Y

    Also for the time :
    it print for exemple : 6:00 PM
    And i would like to have : 18h00

    Thank you lawrence for the help!

    Plugin Contributor lawrenceowen

    (@lawrenceowen)

    @studioleonard Yes, there are several different sample versions, and you need to use the version that I linked for your changes to work. Please try that first and when that is working I’ll help you with the time/date formatting.

    Thread Starter studioleonard

    (@studioleonard)

    Ok it’s done i have uploaded your files.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Date format on the ticket’ is closed to new replies.