zara LiteCart Fan Fra Australia Medlem siden zara 31 aug. 2023 03:58 Is it possible (without major modification of current code) to get a link in the a product page to send an id/title to the contact us page (prefill) the subject field. With regards to the contact us mod. https://www.litecart.net/en/forums/2/general-discussions/18912/hide-price-when-0-and-replace-with-contact-form When the customer clicks contact us link it will prefill the field with the item they are asking about. thanks
tim Founder Fra Sweden Medlem siden tim 31 aug. 2023 11:26 Put ?subject=Lorem+ipsum+dolor in the URL of the contact page to prefill the subject field. <a href="<?php echo document::href_ilink('customer_service', ['subject' => $name]); ?>">Quote For Price</a> <?php } ?>```
zara LiteCart Fan Fra Australia Medlem siden zara 2 sep. 2023 07:15 hi tim thanks for the reply adding in code (to box_product.inc.php): <a href="<?php echo document::href_ilink('customer_service', ['subject' => $name]); ?>">Quote For Price</a> i am getting error {snippet:notices} {snippet:breadcrumbs} also can you please explain what this means in more detial? [i]Put ?subject=Lorem+ipsum+dolor in the URL of the contact page to prefill the subject field.[/i] [i]thanks[/i]
tim Founder Fra Sweden Medlem siden tim 3 sep. 2023 19:47 Example Link: https://demo.litecart.net/customer-service?subject=Lorem+ipsum+dolor {snippet:notices} {snippet:breadcrumbs} is not an error message. What is the error message you are getting? See logs/errors.log
zara LiteCart Fan Fra Australia Medlem siden zara 4 sep. 2023 04:19 thanks, but i am not understanding. could you clarify where this code should be put? <?php if ($final_price == 0) { ?> <a href="<?php echo document::href_ilink('customer_service', ['subject' => $name]); ?>">Quote For Price</a> <?php } ?> i understand putting Put ?subject=Lorem+ipsum+dolor in the URL of the contact page to prefill the subject field. but not how to get that to happen from the product page? thanks
tim Founder Fra Sweden Medlem siden tim 4 sep. 2023 14:42 Put the code in box_product.inc.php where you would want the link displayed. See logs/errors.log for any errors.
zara LiteCart Fan Fra Australia Medlem siden zara 4 sep. 2023 16:00 thanks, i have used the stock box_product.inc.php file and this works, so i need t figure out how to integrate into the ZERO price mod https://www.litecart.net/en/forums/2/general-discussions/18912/hide-price-when-0-and-replace-with-contact-form <?php if ($final_price == 0) { echo ' [b]<a href="<?php echo document::href_ilink('customer_service', ['subject' => $name]); ?>">Quote For Price</a>[/b] ' ; }else{ ?> ill try again thanks again
zara LiteCart Fan Fra Australia Medlem siden zara 5 sep. 2023 09:42 thank got it working, https://www.litecart.net/en/addons/594/hide-price-if-zero-0-mod-zero-0-stock-contact-button would you be able to help more with how the prefill works? ['subject' => $name] how can i know what else i can call and send to the contact us page as prefill? for example, we have "subject" as the "product title", ['subject' => $name] what about if we wanted to have the message body pre filled with : " hello, can you please send me an update on "product title" made by "manufacturer" and or "other" data from the product listing? " thanks
tim Founder Fra Sweden Medlem siden tim 5 sep. 2023 10:16 LiteCart will identify any passed HTTP GET or POST parameters matching the input field name and prefill them (apart from files and passwords). By including a URL parameter named message with a value it will prefill the message field as well. If the value is tremendously long you can attempt HTTP POSTing the values to the page instead. To do so simply produce a form holding the input (type=hidden) values. The form action URL should be the contact page.
zara LiteCart Fan Fra Australia Medlem siden zara 5 sep. 2023 11:05 thanks, this may still be a little to hard for me to understand without exmaple. ['message' => $mpn, 'subject' => $name] i have figure out that much? but struggle with formatting like how to do 'message' => $mpn + $sku + some text but 'message' => $manufacturer does not work? how can i find which $items i can use? thanks again
tim Founder Fra Sweden Medlem siden tim 5 sep. 2023 13:20 The variables you can use are defined in pages/product.inc.php. Inside the template file you can do var_dump(get_defined_vars()); to see all that are defined for that environment. https://www.php.net/manual/en/function.get-defined-vars If you wish to fetch something that isn't defined inside your variable scope in LiteCart you can use the reference model to get it from the database: reference::product($product_id)->mpn https://wiki.litecart.net/introduction#reference_objects To glue strings together in php use dot: 'message' => $mpn .' '. $sku .' '. some text https://www.php.net/manual/en/language.operators.string.php