Author Topic: product enquiry modification (Ask seller info about current product)  (Read 135282 times)

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Hi,

Someone asked for this kind of functionality in another post.

They did not want to have a mailto link on the product page for asking questions.

This mod is based on the joomla contact form, with the same kind of security measures (I hope!). Although I have no way of testing this.

The images below, although muddled, should show what I mean. One file needs modifying in the html directory and your flypage needs amending with another placeholder. This means that you can limit questions to certain categories using your product flypages. Three extra files are added.

in html/shop.product_details.php after

Code: [Select]
/** AVAILABILITY **/
  // This is the place where it shows:
  // Availability: 24h, In Stock: 5 etc.
  // You can make changes to this functionality in the file: classes/ps_product.php
  if( @$_REQUEST['output'] != "pdf" )
    $product_availability = $ps_product->get_availability($product_id);

add

Code: [Select]
//
// Ask seller question
$ask_seller = "";
    $ask_seller = "<a class=\"button\" href=\"$mosConfig_live_site/index.php?option=com_virtuemart&page=shop.ask&flypage=".@$_REQUEST['flypage']."&product_id=$product_id&category_id=$category_id&set=1&Itemid=$Itemid\">";
    $ask_seller .= "Enquiry Form</a>";

and near the end of the file after

Code: [Select]
$template = str_replace( "{product_packaging}", $product_packaging, $template ); // Changed Packaging

add

Code: [Select]
$template = str_replace( "{ask_seller}", $ask_seller, $template ); // Changed Packaging
in your flypage add a placeholder where you would like the enquiry form button added i.e. {ask_seller}
(I have included a flypage called flypage_ask.php this should explain what I mean).

unzip the attached files into administrator/components/com_virtuemart

these are new files and will not overwrite anything.

in virtuemart, click on admin and then modules, list modules. Locate the module named SHOP to the right of this under functions click on LIST. Here you will find a list of functions related to the shop. Click on NEW to add a new function.
Enter these Details:

Function Name:     productAsk
Class Name:              ps_ask
Class Method:             mail_question
Function Perms:         admin,storeadmin,shopper,demo
Function Description:  Enquiry form modification

This sets up the function to work within virtuemart.

in html/templates/order_emails there is a new file called enquiry_email.php

This is the html template for the enquiry form sent to the shop admin.
The customer recieves a text email for confirmation.

If the shop is set to use text emails then thats what you'll get.

I hope this explains everything.

Mark

[attachment deleted by admin]

[attachment cleanup by admin]
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.

MAD King

  • Jr. Member
  • **
  • Posts: 487
  • Supporter Membership - Gold
  • VirtueMart Version: Always the Latest
Yeah, that's it.
Best work.

Thank you very very much.
Joomla! 3.10.11
VirtueMart 4.0.6 10690

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: product enquiry modification (Ask seller info about current product)
« Reply #2 on: April 06, 2006, 12:00:17 pm »
Hi MAD King,

I hope the installation process was not as painful as it seems and I hope it is as seemless as I hoped.

Comments would be appreciated on it's use.

Mark
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: product enquiry modification (Ask seller info about current product)
« Reply #3 on: April 06, 2006, 13:26:49 pm »
Just as an update.

The first mod allows anybody to request information on a product, some users may not want this.

This modified shop.ask.php file requires the user to be registered before allowing requests to be sent, if you are not registered a message appears saying 'please register to use this facility'.

to use just unzip into admimistrator/components/com_vetuemart/html and overwrite the original file.

Mark

[attachment cleanup by admin]
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.

MAD King

  • Jr. Member
  • **
  • Posts: 487
  • Supporter Membership - Gold
  • VirtueMart Version: Always the Latest
Re: product enquiry modification (Ask seller info about current product)
« Reply #4 on: April 07, 2006, 16:33:23 pm »
Hey Mark,

damn good work, but I get an error when I try to send a email or question:

Error: Insufficient Access Rights. You do not have permission to execute productAsk


Joomla! 3.10.11
VirtueMart 4.0.6 10690

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: product enquiry modification (Ask seller info about current product)
« Reply #5 on: April 07, 2006, 17:58:36 pm »
Hi MAD King,

check the access rights of the function you creation in the shop module. (productAsk)

it should be 'admin,storeadmin,shopper,demo' but it should also work with 'none'.

Thats why you are geting the warning.

Mark
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.

MAD King

  • Jr. Member
  • **
  • Posts: 487
  • Supporter Membership - Gold
  • VirtueMart Version: Always the Latest
Re: product enquiry modification (Ask seller info about current product)
« Reply #6 on: April 07, 2006, 18:48:28 pm »
Yes it was 'none'

But I do not receive a email.
Joomla! 3.10.11
VirtueMart 4.0.6 10690

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: product enquiry modification (Ask seller info about current product)
« Reply #7 on: April 07, 2006, 18:59:57 pm »
Do you still get the Error: Insufficient Access Rights. You do not have permission to execute productAsk


if not try changing the email type to text in virtuemart front end and save config. Then try a test mail. Then change back to html mail and try a test again.

I was having problems with this, but this seemed to cure it.

Mark
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.

MAD King

  • Jr. Member
  • **
  • Posts: 487
  • Supporter Membership - Gold
  • VirtueMart Version: Always the Latest
Re: product enquiry modification (Ask seller info about current product)
« Reply #8 on: April 07, 2006, 19:18:52 pm »
I can not send any mail. Either from joomla nor from Virtuemart.
I tried all 3 conf.

php mail function
Sendmail
SMTP Server

What's wrong now? It is driving me crazy.
Joomla! 3.10.11
VirtueMart 4.0.6 10690

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: product enquiry modification (Ask seller info about current product)
« Reply #9 on: April 07, 2006, 20:04:05 pm »
Hi,

was your mail working before this mod?

This mod does nothing to the mail functions within joomla or virtuemart. It just sends mail through the vm mail interface. It doesn't change or alter anything!!

Are you running this on a web server, they should have the info you need to configure email.

Are you running on a test server on a local PC? Is it windows or linux?

I maybe able to help but I need the answers to these questions.

Mark
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.

MAD King

  • Jr. Member
  • **
  • Posts: 487
  • Supporter Membership - Gold
  • VirtueMart Version: Always the Latest
Re: product enquiry modification (Ask seller info about current product)
« Reply #10 on: April 08, 2006, 07:04:13 am »
It is working now. Don't know why.

Thank you for your good hard work.
Joomla! 3.10.11
VirtueMart 4.0.6 10690

Soeren

  • Administrator
  • Sr. Member
  • *
  • Posts: 3106
  • VirtueMart Starter
    • virtuemart.net
Re: product enquiry modification (Ask seller info
« Reply #11 on: April 13, 2006, 10:13:37 am »
This mod will be integrated in VirtueMart 1.1.0. I just have finished the adaption.

Thanks macallf, with some small modifications your mod is great!
What I didn't like was that the "ask page" was just an enhanced copy of the product details page. I just deleted that product details part from the file and it's much clearer now what the form is meant for: to send an enquiry.

What do you think about it?

ciao, Soeren
The future of eCommerce: VirtueMart & Joomla!
http://virtuemart.net

MAD King

  • Jr. Member
  • **
  • Posts: 487
  • Supporter Membership - Gold
  • VirtueMart Version: Always the Latest
Re: product enquiry modification (Ask seller info about current product)
« Reply #12 on: April 13, 2006, 10:25:02 am »
Soeren, what about the pic mod?
If I do not want to show a pic may the script doesnt show any blank pic or "no available picture" and not link to the bigger pic.

And also if I do have only a short description and not a long Product Details.... May you can make that the Product Details... link is not showing if empty?

Thnx
Joomla! 3.10.11
VirtueMart 4.0.6 10690

Soeren

  • Administrator
  • Sr. Member
  • *
  • Posts: 3106
  • VirtueMart Starter
    • virtuemart.net
Re: product enquiry modification (Ask seller info
« Reply #13 on: April 13, 2006, 12:56:56 pm »
Isn't that a bit off-topic??
The future of eCommerce: VirtueMart & Joomla!
http://virtuemart.net

macallf

  • Full Member
  • ***
  • Posts: 2411
    • Mark Callf Design
Re: product enquiry modification (Ask seller info about current product)
« Reply #14 on: April 14, 2006, 02:22:13 am »
Hi Soren

Any help I can provide is OK to me!

I'm glad the mod was of help

Mark
Mark
All of My old mods are now available on my website.
Mark Callf Designs

If you like the work I've done for VM please fell free to Donate

Please Note: I am no longer actively developing or involved with VM development.