WordPress (not woocommerce) Request A Quote functionality

I’ve seen plugins for WooCommerce that provide Request A Quote functionality (turning their cart into a quote request) as well as plugins that are glorified forms (allowing you to select multiple products while ON the form) to submit a request for.

What would be the best solution (coded or plugin) to allow customers to click a button on item pages (custom post types currently) that would add that item’s data to the main contact form (We’re using Gravity Forms currently)?

I’ve looked through the GF docs and they have ways to programmatically add data to the fields.. but I need it to persist while the customer is browsing other pages on the site.


Ex: Customer goes to four different pages, clicks the ‘Request A Quote’ button (we’ll show an alert after they do, that directs them to the Request Form or allows them to keep browsing). Once the customer is navigated to the Request Form, they see the info for the items (we can scrape the title, item #, etc from the post they click the button on) within the main forms Textarea.

Which superhero RPG system is this quote about?

Many years ago, someone shared the following anecdote about a superhero RPG system. (I’ve paraphrased considerably since I don’t remember the exact text.)

Attempts to do weird things to a character, like polymorph them or glue them to a building or send them to the Dream Realms, are modeled using damage. Your turn-into-a-frog power might deal ‘frog damage’, and if a character takes more frog damage than their current hit points, they get turned into a frog. The rationale is that using a debilitating effect on a character should be approximately as difficult as defeating them.

We’ve had some questions recently about "called shots" in D&D contexts, and the existing called-shot systems don’t seem very good, so I was thinking it would be interesting to understand more about how this superhero RPG system worked.

What system was this?

What does the last single quote of the sql injection query: ‘ or “1”=”1″ ‘ mean

I couldn’t fully grasp why the last single quote of the sql query: ' or "1"="1" ' is necessary. So I understand the part until the last single quote ‘. The first single quote enables to inject the sql and the or "1"="1" part enables the query to always return true. However, I don’t understand why the last single quote is necessary to inject the sql.

Contact from 7 image in e-mail dynamique quote

I created a window quote form and add the plugin (contact form 7 dynamic text extension) to solve the static problem, the user filled the form and I receive the information in my mailbox, I would like to display in mail, the image select in the form (type 2,

I cannot display the image. (the text displays but the photo does not) of the window (type 2) in the e-mail, the selected image of the estimate form does not work in the mail of sendings.


<div id=”window_type_2″ class=”sot-window-type”> <h3 class=”title”>2TWO. Type de fenêtre <span class=”modal-open” data-img=”http://2k-fermetures.com/wp-content/uploads/2017/09/009_terrace-2.png”>info</span></h3&gt; <div class=”pf4_form_image_fields pf4_form_image_field__ai1″ data-uid=”.pf4_form_image_field__ai1″> <div class=”pf4_form_image_field” data-bg=”http://2k-fermetures.com/wp-content/uploads/2020/02/1fixe.jpg”&gt; <div class=”pf4_form_image_field_in”> [radio Window use_label_element “FIXE “] <div class=”title_head”>TYPE 1</div> </div> </div> <div class=”pf4_form_image_field” data-bg=”http://2k-fermetures.com/wp-content/uploads/2017/09/009_terrace-2.png”&gt; <div class=”pf4_form_image_field_in”> [radio Window use_label_element “1-Vantaux-ouverture-droit”] <div class=”title_head”>TYPE 2</div> </div> </div> <div class=”pf4_form_image_field” data-bg=”http://2k-fermetures.com/wp-content/uploads/2017/09/009_terrace-2.png”&gt; <div class=”pf4_form_image_field_in”> [radio Window use_label_element “1-Vantaux-ouverture-gauche”] <div class=”title_head”>TYPE 

could you help me ?


How to allow single quote with esc_html__() without sprintf()

Because of security reasons we are of course required to use esc_html__() for WP development. This is annoying because if you’d want to pass a single quote into your strings, you’d have to use sprintf() to make it work. Otherwise you just get &#039; printed out, instead of a '.

Without using sprintf():

esc_html__( 'Wasn\'t your favorite color red?', 'domain' ); // Output: Wasn&#039;t your favorite color red? esc_html__( 'Provided reason isn\'t selected', 'domain' ); // Output: Provided reason isn&#039;t selected 

With the use of sprintf() I can get single quotes to work (of course).

sprintf( esc_html__( 'Wasn%st your favorite color red?', 'domain' ), '\'' ); // Output: Wasn't your favorite color red? sprintf( esc_html__( 'Provided reason isn%st selected', 'domain' ), '\'' ); // Output: Provided reason isn't selected 

I’d like to know if there is a different way to achieve the same output. I am afraid there is none, but I thought why not give it a shot, who knows.

Looking for a specific quote about keys and transparent encryption implementation

I’m struggling to find a quote advising that we should be comfortable in sharing details of encryption methods and implementation with would-be attackers and the system still remain secure. The idea is that the keys are what we should be protecting as opposed to some obscurity in our code and approach.

Does anybody have the quote I’m talking about?

How to indicate a successful price quote (ajax action)?

I am building a system meant for internal employee use. On the page in question, I have a form on the left side and empty space on the right side which will be populated with a table of costs once the user submits the form to request a “price quote”.

My problem is that I don’t know how to indicate success while at the same time not reloading the page, since this is an ajax request and I do value speed.

While having no feedback system is fine for the 1st submit since the empty div will be populated, on subsequent submits the previous div will simply be replaced, and I imagine this will cause problems for users who perhaps fail to click the button and think they have received a new quote. I’m also concerned about users who will spam the submit button and cause unnecessary queries to be run. I currently have a loading animation on the submit button, but getting the quote is too fast to even see it unless the user’s internet is slow.

The image below demonstrates what I’m talking about, sorry for the censoring.enter image description here

My current idea is to briefly flash some kind of green checkmark animation that flashes briefly at the middle of the screen. I’m having trouble searching up how to implement this since I don’t even know what to call it. But I was also curious as to what you guys think and what is the standard for these kinds of operations. Should I just move the result of the query into a modal? Display a green flash message at the top of the screen that dissapears after 3 seconds? Change the text of the “Get Quote” submit button to say “Success!” or something like that?

Products not added to quote for certain customers

I’m adding products to quotes with an ajax call to this function

public function addProductAction(){         $  id = (int)$  this->getRequest()->getParam('id');         $  result = Array();         if($  id){             try {                 $  product = Mage::getModel('catalog/product')->load($  id);                 $  quote = Mage::getSingleton('checkout/session')->getQuote();                 $  options = array(                     'options' => array(                         'label' => 'TestOption',                         'value' => 'Test Value',                    )                 );                 $  quoteItem = $  quote->addProduct($  product, 1);                 $  quoteItem->addOption(new Varien_Object(                     array(                         'product' => $  quoteItem->getProduct(),                         'code' => 'additional_options',                         'value' => serialize($  options)                     )                 ));                 $  quote->collectTotals()->save();                 $  result['itemId'] = $  quoteItem->getId();                  $  result['success'] = 1;                 $  result['message'] = $  this->__('Item was added successfully.');             } catch (Exception $  e) {                 $  result['success'] = 0;                 $  result['error'] = $  e->getMessage();             }          }          $  this->getResponse()->setHeader('Content-type', 'application/json');         $  this->getResponse()->setBody(Mage::helper('core')->jsonEncode($  result));     } 

Most of the time the product is added just fine, lately though I’ve been getting good responses from the function but the product does not show up in the cart.

This happened to a customer that I sent a previous call all the way through the checkout process.

I’m getting no errors anywhere inside log or report, and nothing on screen. The function is returning with a incremented sequence of ID’s like you’d expect. It just doesn’t show when you go the the cart page.

Is there something off about this function?

Magento 1 get quote id of current user

I’ve gone through a number of questions on here relating to retrieving the current quote for the current browsing user, but each one yields the same result:

Mage::getSingleton('checkout/cart')->getQuote() Mage::getSingleton('checkout/session')->getQuote() 

Both give me a quote that has an entity_id of one less than the actual quote I’m looking for.

I can see the correct quote in the db as, let’s say id #100002, but this returns id #100001.

I know that this is not the correct quote because running getCouponCode() returns null and I can see that is because the entity_id that is returned doesn’t have one set, but the actual cart does have a coupon code and so does the entity_id that follows next.