close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

dropship drop down

Thread began 6/11/2019 4:45 pm by Jamie | Last modified 6/13/2019 4:54 pm by Ray Borduin | 23 views | 3 replies |

Jamie

dropship drop down

Hey Ray

Ref the drop ship aspect from yesterday, I have set up a drop down on both qthe product_insert and the inventory_update pages with 'dropship' or 'stock item'

If drop ship is selected then the ProductDropship column is updated to '1' if Stock Item is selected it is updated to 0 and an input field is shown to add the stock number.

Have attached both pages but basically just wondering a couple of things

1. how would I go about creating an update that works so that if dropship is selected it automatically updates the ProductStock column has 0 entered into it even if a value has been added to the ProductStock input field?
2. On a failed validation, if Stock Item is selected the hidden fields become hidden again..how would I go about making them remain visible if the drop down retains 'Stock Item'?

cheers

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

1) Try changing line 119 from:

php:
<input value="<?php echo((isset($_GET["invalid"])?ValidatedField("productcontentsupdate","ProductStock"):"".$WADAproducts->getColumnVal("RemainingInventory")."")); ?>" name="ProductStock" id="ProductStock" type="text" >


to:

php:
<?php

$stockStart 
$WADAproducts->getColumnVal('ProductDropship')?"0":$WADAproducts->getColumnVal("RemainingInventory");
if (isset(
$_GET["invalid"]) {
  
$stockStart ValidatedField("productcontentsupdate","ProductStock")
}
?>
<input value="<?php echo($stockStart); ?>" name="ProductStock" id="ProductStock" type="text" >



2) Update line 115 from:

php:
<div id="StockDiv"  style="display: none;">


to:

php:
<?php

$showIt 
false;
if (isset(
$_GET["invalid"])) {
  if (
ValidatedField("productcontentsupdate","ProductDropship") != "1")  $showIt true;
} else {
  if (
$WADAproducts->getColumnVal('ProductDropship') != "1"$showIt true;
}
?>
            <div id="StockDiv"  style="<?php echo($showIt?'':'display: none;'); ?>">



You should probably also update the select list selections to recognize the failed validation by updating:

php:
<option value="" <?php if (!(strcmp(""$WADAproducts->getColumnVal('ProductDropship')))) {echo "selected=\"selected\"";} ?>>Select Type</option>

                <option value="0" <?php if (!(strcmp("0"$WADAproducts->getColumnVal('ProductDropship')))) {echo "selected=\"selected\"";} ?>>Stock Item</option>
                <option value="1" <?php if (!(strcmp("1"$WADAproducts->getColumnVal('ProductDropship')))) {echo "selected=\"selected\"";} ?>>Dropship Item</option>


to:

php:
<option value="" <?php if (!(strcmp("", ((isset($_GET["invalid"])?ValidatedField("productcontentsupdate","ProductDropship"):"".$WADAproducts->getColumnVal("ProductDropship").""))))) {echo "selected=\"selected\"";} ?>>Select Type</option>

                <option value="0" <?php if (!(strcmp("0", ((isset($_GET["invalid"])?ValidatedField("productcontentsupdate","ProductDropship"):"".$WADAproducts->getColumnVal("ProductDropship").""))))) {echo "selected=\"selected\"";} ?>>Stock Item</option>
                <option value="1" <?php if (!(strcmp("1", ((isset($_GET["invalid"])?ValidatedField("productcontentsupdate","ProductDropship"):"".$WADAproducts->getColumnVal("ProductDropship").""))))) {echo "selected=\"selected\"";} ?>>Dropship Item</option>
Sign in to reply to this post

Jamie

Thanks vm Ray but its not quite working.

Have added a value (3) to the products ProductStock column and then have selected the 'dropship' option from the drop down and updated it but the ProductStock column doesnt ) and still has the value 3 in it in the db

Also, how woudl I modify for the product_insert page as I think the above was just for the inventory_update page?

cheers

Sign in to reply to this post

Ray BorduinWebAssist

We fixed this in a premier support ticket.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...