Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

4 Pages<1234>
Options
Go to last post Go to first unread
stam  
#21 Posted : Monday, January 25, 2010 5:21:42 AM(UTC)
stam

Rank: Newbie

Groups: Member
Joined: 12/23/2009(UTC)
Posts: 2

Dmitry wrote:
dsart wrote:
files are uploaded in support case,

thanks for viewing

Find updated script in your case. Please, let me know if you have some questions.

My case is also the same (one category in virtuemart with products like canvas, tshirt, etc.). Is it possible to have a copy of the mentioned updated script?

Thanks in advance
Stam
andreym  
#22 Posted : Monday, January 25, 2010 10:18:03 PM(UTC)
andreym

Rank: Advanced Member

Groups: Member
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Hello Stam!

I attached the photoorder2.zip with the altered module to the first post.
stam  
#23 Posted : Tuesday, January 26, 2010 7:44:40 AM(UTC)
stam

Rank: Newbie

Groups: Member
Joined: 12/23/2009(UTC)
Posts: 2

Andreym, thanks a lot for the response, cant wait to test it!

Edited by user Tuesday, January 26, 2010 7:46:19 AM(UTC)  | Reason: Not specified

Albertvdmeulen  
#24 Posted : Friday, February 19, 2010 5:22:51 PM(UTC)
Albertvdmeulen

Rank: Advanced Member

Groups: Member
Joined: 3/18/2009(UTC)
Posts: 46

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Switched from photoorder to virtuemart and this works perfect,
exept i have the problem that files with the same name are overwritten.

I thought that the files would be renamed.

Otherwise where can i find where the 'imagepath' is assigned, so i can make different folder with a timestamp.

Rob
andreym  
#25 Posted : Tuesday, February 23, 2010 12:12:15 PM(UTC)
andreym

Rank: Advanced Member

Groups: Member
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Hello!

You can do it in the components/com_photoorder/models/photoorder.php file. The code that saves uploaded files is in the addToCart function.

The $folder variable is assigned at the line 91:
Code:
$folder = JPATH_COMPONENT_SITE.DS.'images';


If you change the folder you also need to change file name in the description (line 142), because now it assumes that all files are stored in the images directory without subfolders. And we save the file name only:
Code:
// add image name to description
$description .= 'imagepath:'.$file['name'];


At the line 116 we make the full file name
Code:
$filepath = $folder.DS.JFile::makeSafe($file['name']);

After this code you can check if file exists and rename it. Note, that in this case you also need to change the file name in the description.
Albertvdmeulen  
#26 Posted : Friday, February 26, 2010 5:22:32 AM(UTC)
Albertvdmeulen

Rank: Advanced Member

Groups: Member
Joined: 3/18/2009(UTC)
Posts: 46

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Dear Andreym,

Thanks for your answer.
Here a quick reply on how i solved it.

Changed:
Code:
$folder = JPATH_COMPONENT_SITE.DS.'images';

into this:
Code:

$date = date("ymdHis");
$folder = JPATH_COMPONENT_SITE.DS.'images'.'/'.$date;


And changed:
Code:
// add image name to description
$description .= 'imagepath:'.$file['name'];

into:
Code:
 // add image name to description
$description .= $date .': '.$file['name'];


This makes a separate folder with timestamp and imagepath is mentioned in before the filename.

grt,

Rob

Edited by user Friday, February 26, 2010 6:37:12 AM(UTC)  | Reason: Not specified

Albertvdmeulen  
#27 Posted : Wednesday, March 17, 2010 3:13:27 AM(UTC)
Albertvdmeulen

Rank: Advanced Member

Groups: Member
Joined: 3/18/2009(UTC)
Posts: 46

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Weird problem!

I got a perfect test website with the virtuemart module and it works perfectly (with thankx to Andreym for pointing me i in the correct direction with some minor problems i ran into).

Made a backup of the website with akeeba (worked also perfectly) and transfered that to our main site (on a different server)
But the strange thing that now occurs is that only one photo is uploaded and when viewing the basket it states that this one is empty.

To be sure that the backup wasn't corrupt, i made a fresh install of joomla, virtuemart and photoorder2 to our main site, but the problem still araises.

Only difference is that on the test server the php setting is: SAFE mode OFF
on the main server PHP SAFE mode on.
Changed the php.ini to SAFE mode off, but still no success
andreym  
#28 Posted : Wednesday, March 17, 2010 1:19:23 PM(UTC)
andreym

Rank: Advanced Member

Groups: Member
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Do you compare what phpinfo() function tells on both of your servers? I think the different php version or php.ini configuration may be the cause of the problem.

Also I think there is some error occurs in the addToCart function in the components/com_photoorder/models/photoorder.php file. Since on fo the uploaded files saved it goes inside the loop
Code:
// save files
for ($i = 1; $i <= $fileCount; $i++) {
   ...
}

, but after saving one file something goes wrong. Are there any errors in your apache's error.log file?
Albertvdmeulen  
#29 Posted : Thursday, March 18, 2010 5:10:08 AM(UTC)
Albertvdmeulen

Rank: Advanced Member

Groups: Member
Joined: 3/18/2009(UTC)
Posts: 46

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Dear Andreym,

Our test server is Apache.
Our main server is Windows 2003 running MySql and PHP.

Found out that the sessions are not written into the database.
Looks like that the problem is with write permissions to the database.
andreym  
#30 Posted : Thursday, March 18, 2010 2:35:09 PM(UTC)
andreym

Rank: Advanced Member

Groups: Member
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Hi Albertvdmeulen!

Can you provide us the link to your site? I will take a look. And the phpinfo result will be very useful too.
Albertvdmeulen  
#31 Posted : Thursday, March 18, 2010 8:06:29 PM(UTC)
Albertvdmeulen

Rank: Advanced Member

Groups: Member
Joined: 3/18/2009(UTC)
Posts: 46

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Hi Andreym,

You'll have a PM.

with kind regards,

Rob
andreym  
#32 Posted : Thursday, March 18, 2010 9:50:48 PM(UTC)
andreym

Rank: Advanced Member

Groups: Member
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Hello!

Nice site! The php version you using on the main server quite old (5.1.6) and according to the manual it does not support the json_decode function, which is used to decode order details
Code:
$order_details = json_decode($description, TRUE);


Also the display_errors option disabled in the php.ini. So server returns empty response while uploading even if some servers errors occurs. If you enable it you will be able to detect server-side script problems with the technique described in this topic.
Albertvdmeulen  
#33 Posted : Friday, March 19, 2010 1:37:57 AM(UTC)
Albertvdmeulen

Rank: Advanced Member

Groups: Member
Joined: 3/18/2009(UTC)
Posts: 46

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Dear Andreym,

Thanks for your reply.
We asked our IT guy to upgraded the server tot PHP 5.2.9
Our only problem is that we have an older site which runs joomla 1.1.13 so hopefully this will work.

If so than we will order a license for our photoorder site and will go live.

Thnkx for you perfect service.Applause

Rob
smartuk  
#34 Posted : Tuesday, March 23, 2010 9:16:46 PM(UTC)
smartuk

Rank: Newbie

Groups: Member
Joined: 1/14/2010(UTC)
Posts: 3

Has any one tried to get this to work with the virtuemart product flypages?

Problem I have at the moment is the client wants to use the normal part of virtuemart to sell pre-printed products. This is fine but it means the "custom image" products also display in a category, when you view the flypage it does not display the java upload.
andreym  
#35 Posted : Wednesday, March 24, 2010 3:39:28 PM(UTC)
andreym

Rank: Advanced Member

Groups: Member
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Hello smartuk!

Well, it is possible. But it requires some additional job. I assume you have virtuemart and photo order component installed. Follow this steps to embed photo order component into the flypage.

First, you need to add this function into the components/com_virtuemart/themes/default/theme.php file:
Code:
/**
   * Create Image Uploader html markup
   * @param $product_sku Product SKU
   * @return String
   */
  function photoorderGetImageUploader($product_sku) {
    //add iuembed script
    $document =& JFactory::getDocument();
    // add json library
    $document->addScript('components/com_photoorder/assets/json2.js');
    // add Aurigma Image Uploader client library
    $document->addScript('components/com_photoorder/assets/iuembed.js');
    // add component helper script
    $document->addScript('components/com_photoorder/assets/photoorder.js');

    $document->addStyleSheet('components/com_photoorder/assets/photoorder.css');

    $tpl = vmTemplate::getInstance();

    //get options
    $path = JURI::base().'components/com_photoorder/assets/';
    $action = JURI::base().'index.php?option=com_photoorder&task=upload';

    $params = &JComponentHelper::getParams('com_photoorder');

    $options = array(
      'id' => 'ImageUploader1',
      'width' => $params->get('width', '650px'),
      'height' => $params->get('height', '400px'),
      'license_key' => $params->get('license_key', ''),
      'upload_source' => TRUE,
      'action' => $action,
      'code_base' => $path
    );

    $tpl->set( 'options', $options );

    //get attributes
    $attrs = array();
    $query = "SELECT product_id, attribute, custom_attribute FROM #__{vm}_product WHERE product_sku='$product_sku'";
    $db = new ps_DB();
    $db->query($query);
    if ($db->next_record()) {
      $row = $db->getCurrentRow();
      $attribute = $row->attribute;
      $attribute = explode(';', $attribute);
      foreach ($attribute as $val) {
        $val = explode(',', $val);
        for ($i = 1; $i < count($val); $i++) {
          // cut off price values and add value to array
          $attrs[$val[0]][] = preg_replace('/\[[+-=\d.,]+\]/', '',  $val[$i]);
        }
      }
      $custom_attribute = $row->custom_attribute;
      $custom_attribute = explode(';', $custom_attribute);
      foreach ($custom_attribute as $val) {
        $attrs[$val] = $val;
      }
      // imagepath should't be rendered
      unset($attrs['imagepath']);
    }

    $tpl->set( 'attributes', $attrs );
    $tpl->set( 'sku', $product_sku );
    // render photo order component from photoorder.tpl.php template file
    return $tpl->fetch('product_details/includes/photoorder.tpl.php');
  }

This function adds javascript and css files into the page and creates html for photo order component.

The second step is to put the photoorder.tpl.php file from the attached archive into the components/com_virtuemart/themes/default/templates/product_details/includes folder. This files contains photo order component template with javascript code for embedding Image Uploader.

And the last, put the photo-flypage.tpl.php file into the components/com_virtuemart/themes/default/templates/product_details folder and use this flypage for category with pre-printed products. This file almost the same as flypage.tpl.php, but with this piece of code
Code:

<tr>
   <td colspan="3"><?php echo $this->photoorderGetImageUploader($product_sku); ?></td>
</tr>

This is the place, where the photo order component will be created.

Edited by user Wednesday, March 24, 2010 4:27:51 PM(UTC)  | Reason: Not specified

File Attachment(s):
photo-flypages.zip (6kb) downloaded 25 time(s).
Albertvdmeulen  
#36 Posted : Friday, April 9, 2010 7:51:43 AM(UTC)
Albertvdmeulen

Rank: Advanced Member

Groups: Member
Joined: 3/18/2009(UTC)
Posts: 46

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
L.S.,

Where can i find the localization for the 'Quantity' field?
I want to translate this.

In the 'administrator/components/com_photoorder/views/order/tmpl/default.php' i have edited several iu.addParam to translate some buttons, but i cannot find where i can change the qauntity field.
It looks like it's outside the uploader.

Hope you can point me in the direction where to change this.

Grt,

Rob

Edited by user Friday, April 9, 2010 7:52:39 AM(UTC)  | Reason: Not specified

andreym  
#37 Posted : Sunday, April 11, 2010 7:14:41 PM(UTC)
andreym

Rank: Advanced Member

Groups: Member
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Hi Rob!

You are right, the Quantity is the attribute of the product. You can change it in the Virtuemart admin on the Product Status tab on the product properties page. There are two attributes in the Custom Attribute List: imagepath and Quantity. You can change them both if you need. But in this case you also need to change this in the components/com_photoorder/models/photoorder.php in the addToCart method:
Code:

// add attributes to description
foreach ($order_details as $name => $value) {
  // exclude quantity value
  if (strtolower($name) != 'quantity') {               // replace this value to yours
    $description .= "$name:$value; ";
  } else {
    $quantity = @intval($value);
  }
}
Albertvdmeulen  
#38 Posted : Wednesday, April 14, 2010 7:28:32 AM(UTC)
Albertvdmeulen

Rank: Advanced Member

Groups: Member
Joined: 3/18/2009(UTC)
Posts: 46

Thanks: 3 times
Was thanked: 1 time(s) in 1 post(s)
Thanks Andreym,

This worked perfectly.
Having a few more questions (and hope that i'm finished then ;-)

01. Is it possible to have bulk prices? i.e. give the customer a discount when he orders 50 10x15's (instead of normal price of i.e 0.50 cents a price of 0.45 cents.

02. Is it possible to predefine the order details? I have now the problem that sometimes they forget to choose between a gloss or a matt finish.
For example if photo 01 is added and they forget to assign the finish when photo 2 is added and a gloss finish is selected, when you then switch back to photo 01 a gloss finish is selected. But to make it more complicated when photo 03 is added and an matt finish is choosen, when you switch to photo 01 then photo 01 finish is matt, when you then switch to photo 02 and then back to photo 01 the finish is gloss!
To prevent this i thought to have this predefined. Maybe in the backend an extra option with the attributes in the photoorder module?

03. Also is it possible to have the qauntity also always to start with 1.
I thought to predefine this in components/com_photoorder/models/photoorder.php
Here in the function addToCart() i changed the $quantity = 0; to $quantity = 1; but this didn't helped

04. One about the license:
Whe orderded the express license and this works fine. But i thought that the image uploader functions were all the same for all different licenses.
Now the Quality meter is not supported with this license?
Maybe i overlooked this and it is may mistake but i couldn't find it in the license overview.

Thanks in advance,

Rob
Dmitry  
#39 Posted : Wednesday, April 14, 2010 7:34:36 PM(UTC)
Dmitry

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 8/3/2003(UTC)
Posts: 1,070

Thanks: 1 times
Was thanked: 12 time(s) in 12 post(s)
Hello Rob,

Quote:
4. ... Now the Quality meter is not supported with this license? Maybe i overlooked this and it is may mistake but i couldn't find it in the license overview.


Quality meter is supported with professional edition only. If you would like to enable quality meter you can purchase this edition and embed it into Virtuemart plug-in. Let me know if you have additional questions on this.
Sincerely yours,
Dmitry Sevostyanov

UserPostedImage Follow Aurigma on Twitter!
andreym  
#40 Posted : Wednesday, April 14, 2010 10:34:13 PM(UTC)
andreym

Rank: Advanced Member

Groups: Member
Joined: 6/16/2009(UTC)
Posts: 134

Was thanked: 8 time(s) in 8 post(s)
Hello!

Quote:
01. Is it possible to have bulk prices? i.e. give the customer a discount when he orders 50 10x15's (instead of normal price of i.e 0.50 cents a price of 0.45 cents.

Yes! It is the standard Virtuemart feature. You can set different prices for different quantities. Go to Administer, open the properties of the product you want to set prices for. Then click List Prices button and add new price.


Quote:
02. Is it possible to predefine the order details? I have now the problem that sometimes they forget to choose between a gloss or a matt finish.
For example if photo 01 is added and they forget to assign the finish when photo 2 is added and a gloss finish is selected, when you then switch back to photo 01 a gloss finish is selected. But to make it more complicated when photo 03 is added and an matt finish is choosen, when you switch to photo 01 then photo 01 finish is matt, when you then switch to photo 02 and then back to photo 01 the finish is gloss!
To prevent this i thought to have this predefined. Maybe in the backend an extra option with the attributes in the photoorder module?

I've tried to reproduce this strange behavior, but with no success. When I change attributes and then click Apply to all, it applies to all files, currently added into the upload list. If I change attributes and does not click Apply to all button, it applies only for selected files. Note, that there are possible to select several files and then it applies to each selected file. But I found another bug when I add file, set order details, then remove from upload list and add again - the order details are not shown in the description field for that file. I've fixed it in the attached photoorder.js file. Please, replace components/com_photoorder/assets/photoorder.js with this one, and replace code into the components/com_photoorder/views/order/tmpl/default.php from this:
Code:
//Add event handlers.
iu.addEventListener("SelectionChange", "ImageUploader1_SelectionChange");
iu.addEventListener("BeforeUpload", "ImageUploader1_BeforeUpload");

to that:
Code:
//Add event handlers.
iu.addEventListener("SelectionChange", "ImageUploader1_SelectionChange");
iu.addEventListener("BeforeUpload", "ImageUploader1_BeforeUpload");
iu.addEventListener("UploadFileCountChange", "ImageUploader1_UploadFileCountChange");


I've also add additional check in BeforeUpload event handler to unsure if the customer specify order details for all selected files:
Code:
if (missingFiles.length > 0) {
  alert('You need to specify order details for this files:\r\n' + missingFiles.join(', '));
  return false; // do not start upload
}



Quote:
03. Also is it possible to have the qauntity also always to start with 1.
I thought to predefine this in components/com_photoorder/models/photoorder.php
Here in the function addToCart() i changed the $quantity = 0; to $quantity = 1; but this didn't helped

Yes. I've made the necessary changes in the photoorder.js file. Find this code and change the 'Quantity' string to your localized name of this attribute.
Code:
// set default value for Quantity attribute
if (!val && el.name == 'Quantity') {
  val = 1;
}



Quote:
04

To add quality meter you need to set QualityMeterFormats parameter. Add this code:
Code:
//Configure quality meter.
iu.addParam("QualityMeterFormats", "9 x 13,1800,1200,1.5;10 x 15,2100,1500,1.5;13 x 18,3000,2400,1.5;15 x 21,4000,3200,2;20 x 30,6000,4000,2");

into the components/com_photoorder/views/order/tmpl/default.php file before
Code:
//Tell Image Uploader writer object to generate all necessary HTML code to embed
//Image Uploader to the page.
iu.writeHtml();

The detailed explanation how to configure quality meter you can find in the documentation.

Edited by user Wednesday, April 14, 2010 10:38:46 PM(UTC)  | Reason: Not specified

File Attachment(s):
photoorder.zip (2kb) downloaded 20 time(s).
Users browsing this topic
4 Pages<1234>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.