Jump to content

tuxy

Members
  • Posts

    49
  • Joined

  • Last visited

Everything posted by tuxy

  1. Ok, I try the PaymentExample.module This renders the order details in a variable '$out' 1. I don't want display it at the PaymentExample.module, only mail this order details. How can I do this? <?php require_once(dirname(__FILE__) . '/PaymentAbstract.php'); class PaymentExample extends PaymentAbstract { public static function getModuleInfo() { return array( 'title' => 'Betaalmogelijkheden', 'version' => 001, 'summary' => 'Betaalmogelijkheden', 'singular' => false, 'autoload' => false ); } public function init() { $this->title = $this->_("Bancontact"); } /* * * returns nothing. You should edit and save $order page. If payment was succesful, * then do $order->removeStatus(Page::statusUnpublished) and remember to save the order! * * If order was also paid, then do $order->sc_paid = time(); * * If order was not paid, but it was succesful (like invoice, money on delivery etc) * then just publish the order, but do not set sc_paid value. * * After you have manipulated the order, then just to redirect to $this->completedUrl * * * @param Page $order keeps the page object for the order * */ public function processPayment(Page $order) { if ($this->input->get->ok) { if ($this->input->get->ok == 'fail') { // We don't remove statusUnpublished. That means failed or cancelled payment $this->session->redirect($this->completedUrl); } if ($this->input->get->ok == 'paid') { $order->setOutputFormatting(false); $order->sc_paid = time(); } $order->removeStatus(Page::statusUnpublished); $order->save(); $this->session->redirect($this->completedUrl); } // No need to really do anything like this on payment module, this is here just for educational purposes): $out = "<h2>Products ordered</h2>"; $out .= "<ul>"; // Products foreach($order->children('check_access=0') as $p) { $out .= "<li><strong>{$p->title}</strong> {$p->sc_price}€ x {$p->sc_qty} (total: ". $p->sc_qty * $p->sc_price ."€)</li>"; } $out .= "</ul>"; $out .= "<h2>Shipping details</h2>"; $out .= "<ul>"; $out .= "<li>First name: $order->sc_firstname</li>"; $out .= "<li>Last name: $order->sc_lastname</li>"; $out .= "<li>Email: $order->email</li>"; $out .= "<li>Street address: $order->sc_streetaddress</li>"; $out .= "<li>Zip: $order->sc_zip</li>"; $out .= "<li>City: $order->sc_city</li>"; $out .= "<li>Country: $order->sc_country</li>"; $out .= "<li>Username: {$order->sc_customer->name}</li>"; $out .= "<li>Email address from user: {$order->sc_customer->email}</li>"; $out .= "</ul>"; $out .= "<h2>Other interesting stuff</h2>"; $out .= "<ul>"; $out .= "<li>Current url: {$this->currentUrl}</li>"; $out .= "<li>Completed url: {$this->completedUrl}</li>"; $out .= "</ul>"; // Usually we would use some payment api or send people to 3rd party service like paypal // and process their reply $out .= "<h3>How do we proceed?</h3>"; $out .= "<ul><li><a href='./?ok=invoice'>Send me an invoice</a>"; $out .= "<li><a href='./?ok=paid'>I pay this with Magic Money™</a>"; $out .= "<li><a href='./?ok=fail'>I want to fail this payment</a>"; return $out; } } PS: When I rename this module by example: PaymentVisa.module then it is disappeared from the payment options menu in the checkout Christophe
  2. Hello, I try find a solution how can, after click 'Place your order' the customer received an email with the order details. For testing i'm trying adding some code like this in the PaymentInvoice.module: ... $pay = $modules->get("ShoppingCheckout")->renderConfirmation(); echo $pay; ... (If this solved, I putting the variable '$pay' in a mail()-function.) But this gives a server error. What do I wrong I spent hours, but with no luck Who can help me find a solution for this??? Christophe
  3. Hello, I installed the Shop-module with succes. Now studying how the checkout-module works. But I have no experience how customizing a module. What I will try to make: 1. If a customer click on [Place your order] then the customer received a confirmation-mail with all the order-details (product-list and his own contact-info) similar that renders in the checkout-page. I find on line 221 public function renderConfirmation() , but I don't know how find/filter the 'order' data. How can I implement a mail() function in the checkout-module? What variables/functions render the order details that I can integrated in the mail-function? Hope that someone can help me Christophe
  4. Nice, beautiful and mobile friendly. I like it
  5. Hi guys, I'm impressed with all this information I'm very happy with this! The project is not for now it is for this summer! But I have an idea how can started, and have a few questions to ask the fitnesscoach about sorting, etc. PS: I can not enough saying that your very helpful people and I think this make the PW community very strong and popular! I very very very happy I find PW when I searching for the best CMS A happy (junior) PW-user, Christophe
  6. Ok, a stupid question: if I can follow: if the user logged in, then the program-page (template) is showing related with the user? Not the standard user-page (user-template)? Thanks for the snippet-examples LostKobrakai I learning best with this!
  7. Ok, I try understand what you mean, but it's not so easy whithout example/code-snippet how realise that. If I can follow you, then added a reference-link-field to the selected videos in the user-template? Fitness Program Project: 1.The first step is uploading ALL the videos. -Videos --Video1 --Video2 ... 2. The coach adding users -Users --User1 --User2 3. The coach selected the videos for each user/client (personal fitness program) ... (I made my first PW project with success (www.springbeestjes.be) and now understanding the basics, but there is a lot more that I want to learning for building great PW sites!) Christophe Yes, that would be nice, and very flexible
  8. tuxy

    My first PW site

    Thank you @pwired I'm a webdeveloper-hobbyist and have many years working with Drupal and in the beginning of the internet i'm interesting in html etc. I'm not a hardcore programmer, but studying myself PHP, HTML, CSS, jQuery, SASS, ... I looking to Open Cart and it like a really nice system. I give this a try, thank you for the info Christophe
  9. But... I think it's better make a new page 'My personal fitness program' / user? Or is it better edit the system template? @mr-fan, This what the coach want: Point 2: should the admin set the videos for the user
  10. Ok, Hiiiii, Thats nice! system templates are new for me This gives me a lot of possibilities. Client x can see 6 videos. Cleint y can see 15 videos. It is different / client. Hmm, i look in the next days to the custom module. thx for the tip! I'm very motivated start this project, with this uselful information. Thank you guys If you has more useful tips, i follow this topic Christophe
  11. Continued... I find this usefull site: http://blog.4digits.net/getting-started-with-processwire/ Here you see the error when I restart apache: For testing I installed a clean PW profile. When i follow the steps on this site , it gives the same errors. Maybe a stupid question: how can I give permissions on a file that only existing at the end of the installation process: chmod 666 site/config.php Christophe
  12. Hello, I upload a PW site to my local server (Raspberry Pi). When i type: http://192.168.0.198/springbeestjes/ The home-page showing fine, but the other subpages gives a 404 error. I searching the whole forum, but no solution Adding random stuff "krbnvhghht" in the top of the .htaccess file Manipulating (uncomment): RewriteBase /springbeestjes/ or RewriteBase /192.168.0.198/ or RewriteBase / or ... edit the apache2.conf file and adding: ... # # AccessFileName: The name of the file to look for in each directory # for additional configuration directives. See also the AllowOverride # directive. # AccessFileName .htaccess AllowOverride All ... This gives an error when restart apache (not in the browser!) I adding several sites in subdirs on my local server without problems. /var/www/site1/ /var/www/site2/ .... Then i type in the browser: http://192.168.0.198/site1/ http://192.168.0.198/site2/ ... The PW-site don't show the sub-pages http://192.168.0.198/springbeestjes/login I'm seeing in phpinfo that mod_rewrite not loaded, then manually loading mod_rewrite and edit again apache2.conf, without success I made a screenshot from phpinfo. Maybe this helps to find a solution. All help is welcome Regards, Christophe
  13. tuxy

    My first PW site

    Hey ESRCH, Thanks for the tip! Foxy Cart is not free Regards, Christophe
  14. user template? you mean the profile-page?
  15. Hi ESRCH! Wauw! Lots of information! Yes, the start of a project is very special with PW, it is the foundation of the whole project! For now I have a lot of time for developing this project (deadline is end of the summer!), but i want preparations and searching for good solutions. In this forum are the experts with PW, and some advice how to start this project is welcome. I like your information, gives me a lot of hope how to start this project, and for myself it is a good way learning PW Grtz, Christophe
  16. tuxy

    My first PW site

    Hi, Thx for the feedback. It's a first version. For now it is a very basic solution. If you buy a product, then it's go to the external PayPal cart-option and there you can select the quantity. It's not the best solution, but it works Yes, its very simple making a shopping-cart only with PayPal. In PayPal you can generate a button and then customizing the html. Its very easy. Here you see the customized PayPal-button code: <?php foreach($products as $product) { ... echo "<form class='buy-button' target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>"; echo "<input type='hidden' name='cmd' value='_cart'>"; echo "<input type='hidden' name='business' value='your@mail.com'>"; echo "<input type='hidden' name='lc' value='BE'>"; echo "<input type='hidden' name='item_name' value='{$product->title}'>"; echo "<input type='hidden' name='item_number' value='{$product->art_nr}'>"; echo "<input type='hidden' name='amount' value='{$product->art_price}'>"; echo "<input type='hidden' name='currency_code' value='EUR'>"; echo "<input type='hidden' name='button_subtype' value='products'>"; echo "<input type='hidden' name='add' value='1'>"; echo "<input type='hidden' name='bn' value='PP-ShopCartBF:btn_cart_LG.gif:NonHosted'>"; echo "<button type='submit' class='btn btn-primary' name='submit'><i class='fa fa-shopping-cart'></i> Nu kopen!</button>"; ... }; I know some pages are not completed, this is work for the client, also the 'hidden' product in the 'Andere' catagory. I sayed him, but for the moment he have no time in the next days for complete the contents on the pages. Next weekend I go to the client and gives him some support, and help him a little how to add, edit or remove pages/products. In a next version I developing a internal cart solution. I want to try this with the shop-module, but this have now mail support In the next weeks I try developing a mail-function that send a mail to the administrator and the customer if the cart submitted. I hope you understand my bad english Regards, Christophe
  17. A fitnesscoach asked me to develop a great new site. It would have over more than 100 short workout video's (max 1 min/video). The coach makes a personal program for each client. In the backend the coach (=admin) selects the video's for each client. Then the client logs in and he only can see the video's that are selected for him. Examples: - Client x -- video 4 -- video 67 -- video 78 --.. Client y -- video 19 -- video 67 -- video 69 --.. Client z -- video 4 -- video 18 -- video 78 -- .. Can anyone give me some suggestions, tips and hints, or practical examples required realizing this project? All help is welcome, thanks already. Regards, Christophe
  18. tuxy

    My first PW site

    This is my first site I made for a client with PW: http://www.springbeestjes.be It is a simple online shop used (for the moment) PayPal. It is expandable for the future. Modules: - Maintenance module http://modules.processwire.com/modules/maintenance-mode/ I want to thank all the PW-people who helped me learning and understanding PW, also for the fast and good support. I like this CMS!!! Now I preparing the next project Regards, Christophe
  19. Aaaaaah, OK Alexander I added only a logout.php file with your code, but NOT a template in the backend Thanks for the useful tip, how finding the page-id Christophe
  20. Hi guys, Thanks for the fast answers. I working on Mac and also have TextWranglers (good tip!) Maybe a tip for some people: type in the url field (Mobile Chrome) before the url 'view-source:' Ex: view-source:http://www.mysite.com I see it now on my Nexus5. But why not a square-symbol when adding a ul-list manually? Grtz, Christophe
  21. Hi Jan Romero, I don't know how can I remove this, i try delete unused characters (spaces ed.) and put the </ul> in a echo, but noting helps. <?php $extra = $pages->get('/extra/'); $children = $extra->children(); echo "<ul class='list-inline text-center extra'>"; foreach($children as $child) { echo "<li><a href='{$child->url}'>{$child->title}</a></li>"; }; echo "</ul>"; The editor I used is Sublime Text. But why is it only when PW the list generated? And not when I add a list manually? I have the same issue in the Top navigation: And yes I have a GOOD Android device Christophe
  22. Hi guys, Thanks for the fast answers. I like it Alexander, I added your code and added a logout.php, but after redirect, it shows a 404 page. Thats the link after click on logout: http://mysite.com/logout?redirect=1 I'm a newbie and not so easy for me this code. I've got the basics, but thats it But I learned Christophe
  23. Hello, I added this code: <?php if($user->isLoggedin()) { // if user logged in, show Logout-link! echo "<a href='login/login/logout'>Logout</a>"; }; If the user logout, then redirect to the same page. How can I do that? Grtz, Christophe
  24. Hello, This is my first real project for a client, made with PW. I have a (little) issue in the site. In the screenshot below you can see in the footer menu, a little square (right). The menu is a inline UL and generated with this code: <ul class="list-inline text-center extra"> <?php $extra = $pages->get('/extra/'); $children = $extra->children(); foreach($children as $child) { echo "<li><a href='{$child->url}'>{$child->title}</a></li>"; }; ?>
 </ul> I tested adding links manually, and then the square is removed. <ul class="list-inline text-center extra"> <li><a href="#">menu 1</a> <li><a href="#">menu 2</a> </ul> How can I remove this square, when the menu is generated by PW? For the moment the site is in development, but you can see the square on your mobile phone on: jolisa.market-locator.com Regards, Christophe
  25. Hi PWers, Sorry for the very late reply. But I will thank you all for this clear answers, now I understand. It's very logical Regards, Christophe
×
×
  • Create New...