News:

Looking for documentation? Take a look on our wiki

Main Menu

User price offers

Started by guybr, June 07, 2015, 08:44:16 AM

Previous topic - Next topic

guybr

Hi, I'm using VM 2.6.6 and want to do something fairly simple: I want to mark certain products as ones where I'm open to receiving a "make an offer" from visitors.

I want to use the custom field function to display a contact us button (labelled "Make an Offer"), which would link to a form with relevant "make an offer" text (either a replication of the existing "ask a question" form with altered subject line, or access to a custom-form extension).

How can I do that??

AH

Quotefairly simple

QuoteHow can I do that??

Looks like your first comment was made without any understanding of the potential complexity!  Hence you second comment.

http://www.open-tools.net/virtuemart/name-the-price.html

Maybe this developer could help further.

Regards
A

Joomla 4.4.5
php 8.1

guybr

#2
Thanks for the link - I'll check it out.

But for my understanding, what is complex about my request? If I mark certain items as being open for an offer, all I need is a conditional php code to display a link to a contact us form -?

...is there a way to associate more extensions (eg a contact form) via the custom field "plugin" selection?

GJC Web Design

by detecting the custom field and showing the form....
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AH

sounds very straightforward then...
Regards
A

Joomla 4.4.5
php 8.1

guybr

#5
I've been able to get the special contact-us options to display conditionally - but I can't get the URLs to render correctly:

I used the original "ask a question" URL (from productdetails/view.html.php):

   $askquestion_url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id . '&tmpl=component', FALSE);

   $this->assignRef('askquestion_url', $askquestion_url);


and assigned a variation of it to the customized contact option I want to display just below in that file:

   $makeoffer_url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=makeoffer&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id . '&tmpl=component', FALSE);

   $this->assignRef('makeoffer_url', $makeoffer_url);


But when the product details page displays, the URL for the "make offer" button does not include the &task= part nor the &tmpl= part, and so it pulls up the site homepage.

I also tried using the URL format of the "recommend" email, and there I can get the 2 missing portions to display... but then the itemid and language elements go missing and the URL still doesn't work.

This is how I'm getting the button displayed (identical style code to the "ask question" except that the URL isn't correct...):

<?php
// Make an Offer contact us option, if set for this item. The customfield should be admin only and hidden.
if (!empty($this->product->customfieldsSorted['offer'])) {
    ?>
          <div class="make-an-offer">
            <a class="make-an-offer" href="<?php echo $this->makeoffer_url ?>" rel="nofollow" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_MAKE_OFFER_LBL') ?></a>
              <!--<a class="ask-a-question modal" rel="{handler: 'iframe', size: {x: 700, y: 550}}" href="<?php echo $this->makeoffer_url ?>"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_MAKE_OFFER_LBL') ?></a>-->
          </div>
      <?php }
      ?>



any ideas what I'm doing wrong? What does the "FALSE" in the URL do?

(I have, of course, duplicated the "askquestion" view, renamed it to "makeoffer" and made all the string-label and css adjustments [ref: vmsite-ltr.css] to reflect that this is a separate email)