Forum

Thread tagged as: Problem

assets in 2.7.2, can only have one image for product...

Hi, my product template, as 5 images that can be uploaded. with the upgrade. I can only upload one image.

  it there a way, to allow multiply images, or is there a way to use the old (non assets system)

tony

<div class="product"> <h3><perch:shop id="productTitle" /></h3>

<perch:if exists="productImage">
    <img src="<perch:shop id="productImage" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />        
</perch:if> 
<perch:if exists="productImage2">
    <img src="<perch:shop id="productImage" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />        
</perch:if> 
<perch:if exists="productImage3">
    <img src="<perch:shop id="productImage" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />        
</perch:if> 
<perch:if exists="productImage4">
    <img src="<perch:shop id="productImage" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />        
</perch:if> 
<perch:if exists="productImage5">
    <img src="<perch:shop id="productImage" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />        
</perch:if> 
Tony Monckton

Tony Monckton 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Your IDs are all productImage. This means you upload one image and Perch will crop the different sizes.

If you want to upload more than one image you need to give them different IDs. This has not changed.

Aha, thank Rachel. I must have copied an old product.html, which had the all the same ids.

tony

Hi Rachel,

I've updated the template (perch/templates/shop) but still only have one image upload.

any ideas? as I need this working asap.

kind regards

tony

Perch: 2.7.2, PHP: 5.3.29, MySQL: 5.1.73, with PDO Server OS: Linux, cgi-fcgi Installed apps: content (2.7.2), assets (2.7.2), categories (2.7.2), app_manager (2), perch_gallery (2.8.5), perch_mailchimp (2.0.1), perch_shop_paypal (1.2), perch_blog (4.0.3), perch_podcasts (1.0), perch_twitter (3.2) App runtimes: <?php $apps_list = array( 'content', ); PERCH_LOGINPATH: /perch PERCH_PATH: /nfs/c05/h06/mnt/78335/domains/ohnappydays.purpletangmedia.com/html/perch PERCH_CORE: /nfs/c05/h06/mnt/78335/domains/ohnappydays.purpletangmedia.com/html/perch/core PERCH_RESFILEPATH: /nfs/c05/h06/mnt/78335/domains/ohnappydays.purpletangmedia.com/html/perch/resources Image manipulation: GD PHP limits: Max upload 20M, Max POST 20M, Memory: 99M, Total max file upload: 20M Resource folder writeable: Yes HTTP_HOST: ohnappydays.purpletangmedia.com DOCUMENT_ROOT: /home/78335/domains/ohnappydays.purpletangmedia.com/html REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

<div class="product"> <h3><perch:shop id="productTitle" /></h3>

<perch:if exists="productImage">
    <img src="<perch:shop id="productImage" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />        
</perch:if> 
<perch:if exists="productImage2">
    <img src="<perch:shop id="productImage2" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage2" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage2" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage2" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />       
</perch:if> 
<perch:if exists="productImage3">
    <img src="<perch:shop id="productImage3" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage3" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage3" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage3" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />       
</perch:if> 
<perch:if exists="productImage4">
    <img src="<perch:shop id="productImage4" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage4" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage4" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage4" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />       
</perch:if> 
<perch:if exists="productImage5">
    <img src="<perch:shop id="productImage5" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage5" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage5" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage5" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />       
</perch:if> 
Drew McLellan

Drew McLellan 2638 points
Perch Support

Which template have you updated?

product.html is the one. I've tried the working template from a Perch: 2.3 website, and still only one image upload.

full template:

<div class="product"> <h3><perch:shop id="productTitle" /></h3>
<perch:if exists="productImage"> <img src="<perch:shop id="productImage" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />
</perch:if> <perch:if exists="productImage2"> <img src="<perch:shop id="productImage2" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage2" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage2" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage2" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />
</perch:if> <perch:if exists="productImage3"> <img src="<perch:shop id="productImage3" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage3" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage3" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage3" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />
</perch:if> <perch:if exists="productImage4"> <img src="<perch:shop id="productImage4" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage4" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage4" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage4" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />
</perch:if> <perch:if exists="productImage5"> <img src="<perch:shop id="productImage5" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage5" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage5" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" /> <img src="<perch:shop id="productImage5" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop" />" alt="<perch:shop id="productTitle" />" />
</perch:if>

<div class="details">   
    <perch:shop id="productDescHTML" encode="false" />

    <perch:form id="_xclick" method="post" action="https://www.paypal.com/cgi-bin/webscr">
        <perch:input type="hidden" name="business" value="<perch:setting id="perch_shop_paypal_email" />" />
        <perch:input type="hidden" name="currency_code" value="GBP" /> 
        <perch:input type="hidden" name="cmd" value="_cart" />
        <perch:input type="hidden" name="add" value="1" />     
        <perch:input type="hidden" name="item_name" value="<perch:shop id="productTitle" />" />
        <perch:input type="hidden" name="item_number" value="<perch:shop id="productCode" />" />
        <perch:input type="hidden" name="amount" value="<perch:shop id="productPrice" />" />
        <perch:input type="hidden" name="shipping" value="value="<perch:setting id="perch_shop_product_postage" />" />
        <perch:input type="hidden" name="shipping2" value="value="<perch:setting id="perch_shop_product_postage2" />" />

        <perch:if exists="productOptions_html"><perch:shop id="productOptions_html" encode="false" type="hidden" /></perch:if>

        <div class="buttons">
            <perch:input type="submit" name="add" value="Add to cart" />
            <span class="price">Price: &pound;<perch:shop id="productPrice" />,</span>
        </div>      
    </perch:form>   
</div>
<hr>

</div>

Drew McLellan

Drew McLellan 2638 points
Perch Support

If I try your template, I get 5 images.

I have diff my changes for edit-pre and edit-post. but can't see anything bad.

looked at $form->receive_from_template_fields, but looks too complicated to debug.

I have tried replacing edit-pre and edit-post from Perch_shop_paypal_V1.2-2, sill only get one image upload.

I also used the original product.html from Perch_shop_paypal_V1.2-2, and added another image. still only one image. template: <div class="product"> <h2><perch:shop id="productTitle" /></h2>

<perch:if exists="productImage">
<img src="<perch:shop id="productImage" label="Image" type="image" width="640" height="640" crop="true" />" alt="<perch:shop id="productTitle" />" />
</perch:if> 
<perch:if exists="productImage2">
<img src="<perch:shop id="productImage2" label="Image" type="image" width="640" height="640" crop="true" />" alt="<perch:shop id="productTitle" />" />
</perch:if> 

<div class="details">



    <perch:shop id="productDescHTML" encode="false" />

    <perch:form id="_xclick" method="post" action="https://www.paypal.com/cgi-bin/webscr">


    <perch:input type="hidden" name="business" value="<perch:setting id="perch_shop_paypal_email" />" />
    <perch:input type="hidden" name="currency_code" value="GBP" /> 
    <perch:input type="hidden" name="cmd" value="_cart" />
    <perch:input type="hidden" name="add" value="1" />     
    <perch:input type="hidden" name="item_name" value="<perch:shop id="productTitle" />" />
    <perch:input type="hidden" name="item_number" value="<perch:shop id="productCode" />" />
    <perch:input type="hidden" name="amount" value="<perch:shop id="productPrice" />" />

    <perch:if exists="productOptions_html"><perch:shop id="productOptions_html" encode="false" type="hidden" /></perch:if>

    <div class="buttons"><perch:input type="submit" name="add" value="Add to cart" />  <span class="price">Price: &pound;<perch:shop id="productPrice" /></span></div>
    </perch:form>   
</div>

</div>

help!

tony

maybe the server has PHP 5.3.29?

tony

Upgraded to PHP 5.5.18, still no joy,

how can I debut $Form?

and would if be possible to use $Form in add a new image upload? e.g: add this below:

<perch:if exists="productImage2">
    <img src="<perch:shop id="productImage2" label="Image" type="image" height="100" crop="true" quality="75" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage2" label="Image" type="image" height="175" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage2" label="Image" type="image" height="375" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />
    <img src="<perch:shop id="productImage2" label="Image" type="image" height="750" crop="true" quality="85" bucket="shop"/>" alt="<perch:shop id="productTitle" />" />        
</perch:if> 

tony

Drew McLellan

Drew McLellan 2638 points
Perch Support

If you've been customising the app with your own changes, then we're not really in a position to help. Your template works with the app as it ships.

I've found the problem, and it now works ok.. its too complicated to explain other than in PerchShop_Products->Create I need to remove a new form var 'subcat_ids' (check boxes) from $data which came from edit.pre.php... in the same was as 'cat=ids'... edit.pre.php collects: $postvars = array('productID','productTitle', 'productCode', 'productTitleShort', 'productDescRaw', 'cat_ids', 'subcat_ids', 'productCount', 'productStatus', 'productPrice' );

Also in PerchShop_Product->Update

tony