Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

69 Excellent

1 Follower

About MarcoPLY

  • Rank
    Sr. Member
  • Birthday 05/08/1987

Profile Information

  • Gender
  • Location
    Reggio Emilia

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. yes sure, no worry. Thank you for your help. Enjoy the holiday!!
  2. ok @benbyf, thank you I see now. I need make a template to use the module. I use the Padloper, in this case the render method could be better. I see that I have to set up all the information about customer and products, so, I have to include the Padloper Module and use the $order data. But, If I can pass all the data how I can render the form? (I'll try but honestly I don't think I'm able to integrate the two modules. I hope the old stripe module still works after the Stripe changes) Thank you
  3. Hi @benbyf, first thank you for your work. I try to use the module. When I install the module in the checkout instead of the button there is only write "nothing here yet". What mean? I have just copy the setting from the old module, the key and filled the other info. Is there anything I need to do? Update: I see, there isn't yet the render function.
  4. These two are inside a Select Option fields. Check the setting if the fields are installed or enabled: Modules --> Core --> Fieldtype
  5. Hi, I have put the LoginRegister form inside a popup. If someone inserts the data incorrectly, the page is reloaded and the error message is shown, but this is inside the popup and to see the message needs to manually reopen the popup. Is there a way that if an error occurs when the page is reloaded open also the popup? I try just to add the id to the URL, like mysite/page/#modal-Login but when the LoginRegister reload the page the id is deleted. What can I do? For load inside the modal the Forgot page I use this code: $('.LoginRegisterLinksForgot').on('click', function (e) { $.ajax({ url: './', type: "get", data: 'forgot=1', beforeSend: (function () { }), }) .done(function(data){ $('#LoginRegister').html($(data).find('#LoginRegister').html()); }); e.preventDefault(); }); If there are an error can I use something like this? Thank you.
  6. @gmclelland thank you very much. I can see this error only if I connect with a proxy. Maybe a cache problem, I reset ProCache and now the images also load with the proxy. However, if I connect directly the upload problem is gone and the filter tag works. Anyway thank you very much I will continue to do tests to solve the problem. @flydev I completely forgot about this possibility! thank you very much, I use it immediately.
  7. @flydev, yes there are lots of fields to translate! Thanks for the report! @gmclelland, I see all, what do you mean cann't you see the images? @Jonathan Lahijani, absolutely true!
  8. Thank you @bernhard! I just fixed! I used this system and now it works much better:
  9. Hi everyone, a year ago we had put online a first version of our website, which didn't satisfy me much and had several bugs. This year I started working on a complete restyling, both in terms of functionality and graphic. I am very happy with the result obtained. Finally, last week we put this version online that I am proud to show you! Site EU: https://www.playwood.it/ Site USA: https://www.us.playwood.it/ It is an eCommerce for a small StartUp, the PlayWood, based in Reggio Emilia, Italy. The site is multilingual, has two areas of purchase and has two levels of registration. Redirectory based on the source IP for the USA customer and preferred language in the browser for the others countries. It has systems for use registration and sending emails dependent on specific actions, like: registration, purchase, request for quotes, information request, etc. Through the API the site communicates with external platforms such as the management software, Mailchimp and other systems to support marketing and company operations. The site is constantly evolving, in the future we intend to add new features. The site was created with these modules: Padloper Login/register Media Library ProCache PayPal Checkout Subscribe to Mailchimp Tracy Debugger Cookie Management Banner Continent and country names ImagePicker Field Map Marker External libraries: Spectre, scss framework Swiper slideshow verlok/lazyload fancybox Creating this site with ProcessWire represented a moment of strong professional growth. When I started I had little knowledge of some types of language, but Processwire and its APIs give me the ability to easily build pages, manipulate data and integrate any external library easily. Thus, I was able to deepen my knowledge more and more. So I wanted to thank the creators of the cms, who keeps it and who implements it, obviously all the people in the forum for the help they gave me, was very important. Thank you!
  10. A few days ago I received an e-mail from Stripe where he said that by the 14th of September, two-factor authentication should be implemented for online payments. --> article I seem to understand that for the module ecommere here on PW we need to update the API. They sent me to this page: here Or other possibility is to use the new version of Stripe's checkout, at this link. I wanted to ask if someone has plans to update the module? ------ @kongondo, probably you already know, but anyway for the new version of Padloper this could be interesting.
  11. I like pwCommerce. For users it is much easier to understand pwCommerce, it is very intuitive and simple. Which from the commercial point of view is a fundamental characteristic. For the class I don't have idea. but also need be something connected with the name. Idea for the logo! If you don't already have one, you could launch a contest among community members! will be something fun. Maybe just for the concept, after all the branding you'll see how to do it.
  12. Hi,@kongondo the screen look amazing!! I see there are a lot of possibility to trigger the discount code. I don't know if you have already thought about this, but could be a very useful and beautiful option to be able to create discounts dedicated to specific users. The best if it is possible to give it to those who do certain actions, like make a purchase, sign up for the newsletter or have an abandoned cart. What you think? or just a persona code with expiration date and all the other option.
  13. Hi guys, I try to set up the option values for the options fields. Like it's write here: https://processwire.com/docs/fields/select-options-fieldtype/#separate-option-values EG: I write 123=IT|Italy and render the option value <option value="IT">Italy</option>. I read that need to use $option->value. But I would like to step up a hook to show the custom value when this value exists, otherwise continue to show the ID. Is it possible? I try to work around FieldtypeOptions::formatValue(), but I don't know how setup this hook and if it is the correct way to do it.
  14. Hi, I need to check the VAT number before the user make a registration. I start from here https://github.com/herdani/vat-validation, and this work well. But now I have to integrate this with the LoginRegister module, I'm not sure who do it, at moment I try to make the hook in this way: wire()->addHookAfter('LoginRegister::processRegisterForm', function ($event) { $form = $event->arguments[0]; $company = wire('input')->post->register_Iam; // check if you are a person or a company if ($company == '2') { // Get country code $options = wire('fieldtypes')->get('FieldtypeOptions')->getOptions(wire('fields')->get('shipping_countrycode')); foreach ($options as $value) { if(wire('input')->post->register_shipping_countrycode == $value->id) { $country_title = $value->title; $countryCode = substr($country_title, 0, 2); } } // Get VAT number $vatNumber = wire('input')->post->register_invoice_VAT; $check = new WireFileTools(); $check->include('vatValidation.class.php'); $vatValidation = new vatValidation( array('debug' => false)); $vatValidation->check($countryCode, $vatNumber); if ($vatValidation->isValid()) { return true; } else { $vatError = 'this VAT N° does not exist'; $vatNumber->error($vatError); } } }); I'm not sure but I think that everything works well until validation. How I can add the verification system? I feel like one of the problem is adding the vatValidation.class.php file in the hook. But I can't debug well this. I try to follow this post. Also I read the problem could be a namespace in the vatValidation.class file. But also, I'm not sure. vatValidation.class.php UPDATE I try also to use this $company = wire('input')->post->register_Iam; if ($company == '2'){ // Get country code $options = wire('fieldtypes')->get('FieldtypeOptions')->getOptions(wire('fields')->get('shipping_countrycode')); foreach ($options as $value) { if(wire('input')->post->register_shipping_countrycode == $value->id) { $country_title = $value->title; $countryCode = substr($country_title, 0, 2); } } // Get VAT number $vatNumber = wire('input')->post->register_invoice_VAT; function viesCheckVAT($countryCode, $vatNumber, $timeout = 30) { $response = array (); $pattern = '/<(%s).*?>([\s\S]*)<\/\1/'; $keys = array ( 'countryCode', 'vatNumber', 'requestDate', 'valid', 'name', 'address' ); $content = "<s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'> <s11:Body> <tns1:checkVat xmlns:tns1='urn:ec.europa.eu:taxud:vies:services:checkVat:types'> <tns1:countryCode>%s</tns1:countryCode> <tns1:vatNumber>%s</tns1:vatNumber> </tns1:checkVat> </s11:Body> </s11:Envelope>"; $opts = array ( 'http' => array ( 'method' => 'POST', 'header' => "Content-Type: text/xml; charset=utf-8; SOAPAction: checkVatService", 'content' => sprintf ( $content, $countryCode, $vatNumber ), 'timeout' => $timeout ) ); $ctx = stream_context_create ( $opts ); $result = file_get_contents ( 'http://ec.europa.eu/taxation_customs/vies/services/checkVatService', false, $ctx ); if (preg_match ( sprintf ( $pattern, 'checkVatResponse' ), $result, $matches )) { foreach ( $keys as $key ) preg_match ( sprintf ( $pattern, $key ), $matches [2], $value ) && $response [$key] = $value [2]; } return $response; } $arr = viesCheckVAT($countryCode, $vatNumber); if ($arr[valid] == fasle) { ... } } This probably are better, but I'm not able to integrate with the validation of the module. ONE SOLUTION In the end I failed to make the hook as I wanted. So I thought I'd check the VAT before the module registered the user. Ok maybe it's not the best solution but it works. So, with the help of one person, we started from the PHP function I posted above, changing it this way: We sent a request via Ajax, this is activated when data is entered the input, this call via curl and returns a value that, following the logic in this case with a nice callback, enables or disables the send button 🙂 <?php if( $_SERVER['REQUEST_METHOD']=='POST' && !empty( $_POST['task'] ) && $_POST['task']=='check' ){ ob_clean(); $result=null; function curl( $url=NULL, $options=NULL, $headers=false ){ /* Initialise curl request object */ $curl=curl_init(); /* Define standard options */ curl_setopt( $curl, CURLOPT_URL,trim( $url ) ); curl_setopt( $curl, CURLOPT_AUTOREFERER, true ); curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, true ); curl_setopt( $curl, CURLOPT_FAILONERROR, true ); curl_setopt( $curl, CURLOPT_HEADER, false ); curl_setopt( $curl, CURLINFO_HEADER_OUT, false ); curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $curl, CURLOPT_BINARYTRANSFER, true ); curl_setopt( $curl, CURLOPT_CONNECTTIMEOUT, 20 ); curl_setopt( $curl, CURLOPT_TIMEOUT, 60 ); curl_setopt( $curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36' ); curl_setopt( $curl, CURLOPT_MAXREDIRS, 10 ); curl_setopt( $curl, CURLOPT_ENCODING, '' ); /* Assign runtime parameters as options */ if( isset( $options ) && is_array( $options ) ){ foreach( $options as $param => $value ) curl_setopt( $curl, $param, $value ); } if( $headers && is_array( $headers ) ){ curl_setopt( $curl, CURLOPT_HTTPHEADER, $headers ); } /* Execute the request and store responses */ $res=(object)array( 'response' => curl_exec( $curl ), 'info' => (object)curl_getinfo( $curl ), 'errors' => curl_error( $curl ) ); curl_close( $curl ); return $res; } function checkvat( $code, $vatnumber, $timeout=30 ){ $url='http://ec.europa.eu/taxation_customs/vies/services/checkVatService'; $content = "<s11:Envelope xmlns:s11='http://schemas.xmlsoap.org/soap/envelope/'> <s11:Body> <tns1:checkVat xmlns:tns1='urn:ec.europa.eu:taxud:vies:services:checkVat:types'> <tns1:countryCode>%s</tns1:countryCode> <tns1:vatNumber>%s</tns1:vatNumber> </tns1:checkVat> </s11:Body> </s11:Envelope>"; $headers=array( 'Content-Type' => 'text/xml; charset=utf-8', 'SOAPAction' => 'checkVatService' ); $options=array( CURLOPT_POST => true, CURLOPT_POSTFIELDS => sprintf ( $content, $code, $vatnumber ) ); return curl( $url, $options, $headers ); } $code=$_POST['code']; $vatnumber=$_POST['vat']; /* check the VAT number etc */ $obj=checkvat( $code, $vatnumber ); /* if we received a valid response, process it */ if( $obj->info->http_code==200 ){ $dom=new DOMDocument; $dom->loadXML( $obj->response ); $reqdate=$dom->getElementsByTagName('requestDate')->item(0)->nodeValue; $valid=$dom->getElementsByTagName('valid')->item(0)->nodeValue; $address=$dom->getElementsByTagName('address')->item(0)->nodeValue; if ($valid == "true") { $result = "<p style='background-color: #fff;width: 30%;color:green;position: absolute;'>Valid Number</p>"; } else { $result = "<p style='background-color: #fff;width: 30%;color:red;position: absolute;'>Not Valid Number</p>"; } } exit( $result ); } ?> <script> const ajax=function( url, params, callback ){ let xhr=new XMLHttpRequest(); xhr.onload=function(){ if( this.status==200 && this.readyState==4 )callback( this.response ) }; xhr.open( 'POST', url, true ); xhr.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' ); xhr.send( buildparams( params ) ); }; const buildparams=function(p){/* construct payload/querystring from object */ if( p && typeof( p )==='object' ){ p=Object.keys( p ).map(function( k ){ return typeof( p[ k ] )=='object' ? buildparams( p[ k ] ) : [ encodeURIComponent( k ), encodeURIComponent( p[ k ] ) ].join('=') }).join('&'); } return p; }; document.addEventListener('DOMContentLoaded', ()=>{ let form = document.getElementById('LoginRegisterForm'); form.register_invoice_IVA_VAT.addEventListener('keyup', e=>{ let url=location.href; let params={ 'task':'check', 'vat': form.register_invoice_IVA_VAT.value, 'code':'IT' /*need to hook the select filed because now return the ID number*/ }; let callback=function(r){ let vatF = document.getElementById('register_invoice_IVA_VAT'); var thisreturn = r.includes("Not"); var divNew = document.createElement("div"); divNew.innerHTML = r; if (thisreturn == false) { vatF.classList.add('success'); vatF.classList.remove('error'); document.getElementById("register_submit").disabled = false; document.getElementById('wrap_register_invoice_IVA_VAT').appendChild(divNew); } else { vatF.classList.add('error'); vatF.classList.remove('success'); document.getElementById("register_submit").disabled = true; document.getElementById('wrap_register_invoice_IVA_VAT').appendChild(divNew); } } ajax.call( this, url, params, callback ); }) }); </script> So, I didn't make the hard coding part to be complete honest I ask in stackoverflow here, but anyway I want also add this post here if anyone in this form needed it, it can be a starting point. (Maybe could be a interesting features for the new Padloper or some ecosystm module @kongondo)
  15. Wow super! The API system look amazing! I know you still have to tell us many things, like how works the discounts, users management, shipments, payments, etc. But I will like ask a few things 🙂 The API system for get the $order data will change? eg: At the moment I am using the success page or the checkout page to send the order data to external platforms such as our management, Mailchimp, google analytic etc. Will it be possible to continue doing it from there? I see there is the discount page, but also will be possible to change the price in the shopping cart based on the items loaded? eg: discounts based on quantity. Will it be possible to do this as a backend or do it with a separate hook? Will it be possible to choose the type of shipment in the checkout process? eg: normal, super fast... A curiosity, are you also creating new payment module? I think that ProcessWire has the potential to become the cms with the best e-commerce system around!
  • Create New...