Forum Replies Created
- AuthorPosts
-
when you are saying “only a part of it”
which “parts” in particular do not work…
(admin? frontend? some global text strings ? or particular plugins/themes only ?)Assuming you are happy to edit some php files (let me know if that is not the case )
could you please try the following(I dont use WPML really as such , so it would be great if you could let me know if the below solves your problem and does not cause any others elsewhere before I makes this actually part of an update)
in [your site path]/wp-content/plugins/wppizza/classes/class.wppizza.categories.php you will find at approx line 118 the following codeblock
if(function_exists('icl_get_languages')){ global $sitepress; $languages = icl_get_languages(); /**loop through non current languages to get categories**/ foreach($languages as $lang_code=>$lang_arr){ if($lang_code!=ICL_LANGUAGE_CODE){ $sitepress->switch_lang($lang_code); /*get cats for that language**/ $wpml_sort_cats_lang[$lang_code] = get_categories($args); } } /**make sure we switch back to current language when done**/ $sitepress->switch_lang(ICL_LANGUAGE_CODE); }
REPLACE that whole codeblock with
if(function_exists('icl_get_languages')){ global $sitepress; $languages = icl_get_languages(); /**loop through non current languages to get categories**/ foreach($languages as $lang_code=>$lang_arr){ if($lang_code!=ICL_LANGUAGE_CODE){ $sitepress->switch_lang($lang_code); /*get cats for that language**/ $wpml_sort_cats_lang[$lang_code] = get_categories($args); } /**make sure we switch back to current language when done**/ $sitepress->switch_lang(ICL_LANGUAGE_CODE); } }
i.e move the second ->switch_lang() inside the loop
let me know if that solves the issue in your case too – seems to work fine when i do this here in a test environmentforget that question. i watched the video you linked to and figured it out from there what the versions are
i’ll see what happens when i do this locally here first of all and will get back to you when i know morefirst of all, what versions of wppizza and wpml are we talking about please?
the last one left is using a filter then .
so something like this (i assume you know how wordpress filters work and how/where to use them)/* remove first <td> (label) from customer data in emails and/or print templates */ add_filter('wppizza_filter_template_customer_section', 'myprefix_remove_customer_labels', 10, 3); function myprefix_remove_customer_labels($markup_array, $template_type, $tplId){ /* only filter for print templates else return as is */ if($template_type != 'print'){ return $markup_array; } /* // if required one could also restrict by template id like // if($tplId != 3){return $markup_array;} */ /* quick remove colspan from thead, as we are removing all label td's to end up with one td only per tr */ $markup_array['section_label'] = str_replace('colspan="2"', '' , $markup_array['section_label']); /* all customer data fields - by array keys - where we want to remove the label td intersecting the 2 we want to keep, with the rest */ $customer_data_keys = array_diff( array_keys($markup_array), array('section_label', 'tbody_', '_tbody')); /* remove first td of all customer data */ foreach($customer_data_keys as $cdKey){ /* quick and dirty explode Note: could also (should probably) be done by regex or parsing dom document or whatever else one can think of as perhaps - though not very likely - one day there might end up being a space or something between the "</td><td" for some as yet unknown reason it's just a note if you want to make this more "future proof" */ $orig_string = explode('</td><td', $markup_array[$cdKey]);// explode by closing/opening td's $new_str = '<tr><td'.$orig_string[1];//prepend tr->td to second part of exploded array $markup_array[$cdKey] = $new_str;//put it together } return $markup_array; }
4 January, 2020 at 2:37 pm in reply to: Any chance of adding hidden fields with validator rule password #46125This reply has been marked as private.4 January, 2020 at 2:30 pm in reply to: Any chance of adding hidden fields with validator rule password #46124as it turns out – looking at that site – your problem has nothing to do with any of this .
It is simply due to the order page being cached (or perhaps – less likely though – some php session problem)If I clear my cache and go directly to your orderpage (https://yoursite.tld/pantanir/) without ever having put anything into the cart, i STILL get items from some previous / other users.
the order page must not ever be cached
https://docs.wp-pizza.com/getting-started/?section=setup
https://docs.wp-pizza.com/faqs/?section=using-a-cache-plugini would also suggest you update wppizza to the latest version (3.10.7) which addresses a few other potential issue
3 January, 2020 at 7:19 pm in reply to: Any chance of adding hidden fields with validator rule password #46116As of wppizza 3.10.7 noone should be able to use a gateway that is not enabled in your backend , no matter how much they try to tamper with the frontend
of course, if you – or anyone else for that matter – still experiences this , i want to to know about it !!
(I’m kind of surprised myself that i overlooked this possibility for so long to be honest. But better late than never I guess…..)
3 January, 2020 at 5:37 pm in reply to: Any chance of adding hidden fields with validator rule password #46115PS: please mark any reply as private
3 January, 2020 at 5:28 pm in reply to: Any chance of adding hidden fields with validator rule password #46114instead of messing around with hidden fields – which anyone can manipulate anyway (though it depends on what exactly you are doing with it of course) it strikes me like a much better idea to disallow submission of non-enabled gateways in the first place. This should most definitely happen server side.
looking at it in a bit more detail, i can see how one could change from STRIPE for example to COD , and I will certainly fix this as a matter of priority asap.
However, if someone submits a COD order and you have not enabled anything other than one particular credit card gateway, I would have thought you would know that someone has messed around with things and should ignore the order so am not quite sure how someone can successfully claim to have a gift certificate (i dont even know where this “gift certificate” comes from ….)that said, it’s somewhat abstract , so if you can give me a walkthrough on your site as how people claim for some gift certificates as well as manipulate the checkout process i would be most interested.
some random epson doc i have come across which may or may not be relevant
https://files.support.epson.com/htmldocs/pho925/pho925rf/vari_2.htmit says there :
“Printing on roll paper
You need to make your data 4 mm wider than the roll paper.”so a -4mm (left only ?) margin on the body *might* be what works – assuming your printer is an epson printer….
just posting things as i come across them here for future reference perhapsthanks for the screenshots.
from what i can see, your issue isn’t actually the html/css as the printer does seemingly print bold and table columns etc (referring to the screenshot https://prnt.sc/qito1l) but that it forces left and right margins .The most appropriate solution I would think is setting the margins on the printer to something smaller / zero.
However it might be the case that the printer does not allow for this to be adjusted.
If that is the case, my idea would be to add the following to the css declarationsa) set the body margins in the css declaration to something negative . i.e
body { margin-left: -100px; margin-right: -25px; }
or perhaps in mm
body { margin-left: -10mm; margin-right: -5mm; }
(you might have to play with the values until it fits)
b) regarding customer labels, add the following
#customer tbody > tr > td:first-child { display: none; }
which should hide the labels there
always provided the printer does in fact understand this sort of thing.
let me know if the above makes any difference please3 January, 2020 at 12:44 am in reply to: How make a new line between customer tags and values #46108> I have this problem in many thermo printers.
I am sure you do.
<rant> (the majority of) thermal printers are technologically still stuck in the 80's from what I can tell All I (i.e wppizza) can do is output valid, standard html and/or plain-text documents (and with the pdf plugin pdf's too - as attachments) that can be send to and printed by a/the printer. It is completely out of my hands as to what the printer does with this when printing. From what I can tell, most thermo printers simply do not follow *any* standard and/or do their own thing as to whatever the company has dreamt up at the time the format should be without any consideration at all as to any standards. Afaik, in many cases one cannnot even select the most basic things like fonts or fontsizes , let alone anything more specific.... I must admit, I find the arrogance/laziness (call it what you will) of printer manufacturers on that front quite staggering to be honest ..... (i could rant on about this for quite a while here, but it wont help you of course, so i wont ------- for now :)) </rant>
So, that off my chest (sorry) back to the issue at hand:
(You did not address this question) – Did you try setting your template you are using for printing to plaintext ?
is the output better/worse ?
perhaps could you post a screenshot of both outcomes ?Btw, I’m not trying to be difficult, just trying to find the most appropriate workaround/solution to what really should be someone elses problem (I’m referring to printer manufacturers here, please don’t take this as a dig at you !)
to perhaps come up with something that helps not only in your particular case but might be generally useful for others too coming across this post…..although theoretically doable, i cannot see how this could help
in a nutshell, the html output is something like this
.... <tr><td>some label</td><td>some value</td></tr> ...
so just adding a
<br>
before/after the label / value will still keep it all in their own table column
adding a<br>
after the closing</tr>
is simply invalid html (and will therefore in most cases be ignored probably anyway)are you sure your printer can actually print html in the first place ?
have you tried using a plaintext template with that printer ?29 December, 2019 at 11:28 pm in reply to: How make a new line between customer tags and values #46050the print templates print what you have set up in wppizza -> templates -> print (or “emails” if your printer prints from the emails received – depends on setup and what your printer “listens” to )
if you want to change the order of things – i.e move things below some other things – simply drag and drop there and savebtw, this is completely independent of what the confirmation page shows (which follows the settings in wppizza->order form)
the default [html] templates (in wppizza -> templates -> print) are set to 100% width – but feel free to edit this as you wish in the appropriate css declaration boxes there
if you have not changed the css at all then you will have to ask your printer manufacturer as to why it does not print html as instructed.
however, you should make sure your html and your css is actually valid html/css (i.e all tags are closed properly etc)there is also a bunch of info here
https://www.wp-pizza.com/topic/question-google-cloudprint/22 December, 2019 at 10:54 pm in reply to: Google Cloud Print will be disabled on December 31, 2020 #45991sorry for the late reply…i had actually missed this (but now know of course)
other than using a printer that can connect directly to email accounts for example, I cannot see any other equivalent solution anywhere that would allow us to do what google cloudprint does. so this is a bit , errm, annoying (to say the least)
i live in hope that perhaps someone else will pick up the pieces (IBM, facebook, MS anyone really with the resources) and we can continue using it after 2021 – or perhaps google will change their mind. This change will affect 1000’s of servers/sites after all …..
if anyone else reads this and has some idea as to how to replace this , I would be more than happy to hear it.
I couldn’t find anything myself that allows to print directly from a website to a network printer without having to have some computer in the middle turned on all the time (and that’s not propriotory and only works for one set of printers…)again, any ideas would be appreciated on that front
at some point in the not too distant future i want to look at and update the paypal plugin
but as it works as it is, and there are other things more pressing that need looking at, i cannot give you any ETA as to when this will happen I’m afraidi would also suggest you turn on debug too and check your debug log
https://docs.wp-pizza.com/troubleshooting/if this shows up (unless someone is trying to mess around with some html values) it’s because – most probably – your php sessions are not working and/or you have database errors and/or you are caching the orderpage
without a link to the site where this can be seen , I cannot say much more though
- AuthorPosts