# Question
Title: Create PDF from form data then email PDF
Has anyone come across a situation where the following process is required:

1. HTML form is completed on website
2. Form gets submitted
3. PDF of form details is created
4. Generated PDF is emailed to a specified admin email address

How did you go about it, what plugins (if any) did you use?

Thanks.

# Answer
I believe a number of add-ons, like Exp:resso's Store, that automate the creation of PDF files, use DOMPDF: an HTML to PDF converter. It can be called directly with PHP for use in ExpressionEngine or you can take a look at Patrick Pohler's PDF Press.

I haven't used **PDF Press**, it's pretty new, but with the exception of the one issue with Unicode Characters, that has been fixed/address, I haven't really heard any complaints about it. It's probably the simplest method for adding **DOMPDF** functionality to your website, if you don't like delving into PHP or just don't want to turn PHP on in your templates for security reasons.

There are other PDF converter plugins, but most use something like PDF Crowd. **PDFCrowd** is free for single use or small amounts (up to 100 PDF files), but have a monthly charge if you need to create more than that or have an unknown amount of data, say submission of web forms (you could get 5, 500, or 5000 forms submitted).

As for sending the PDF as an email… you'd probably need to figure out which PDF solution you are going to use first, then you can explore various notification and email solutions like Postmaster or MX Notify. Though admittedly, I'm not certain why you wouldn't just send an HTML formatted email, with a link where a PDF could be generated if needed.
> 2 votes

# Answer
We accomplished this in the past with our own code. PDFLib was the PHP library we used. FPDF is another.

These libraries allow you to create a PDF offline as a template, and then, using PHP, lot your content in the PDF and apply formatting.

> Form gets submitted

You didn't indicate how you were submitting the form. If you're using Freeform, there's a post-submit hook that will allow you to encapsulate your PDF logic in an extension and run that extension any time the form is submitted.

If you're using Safecracker you can set your redirect page to be a post-processor page in your templates. Enable PHP on output for that template, pass the new entry ID on the URL, and use that to get the entry's details. If you have PHP set to run on output, you can pass the entry's values into PHP to bundle into the email.

You'll want to generate and save the PDF to the server, and then use the Email class to build and send your email with the PDF attached.

With all that said, I agree with nonprofit\_tech: Why not send the email with a link to the PDF, or just send the details right in email?

I covered our work with PDFs in https://expressionengine.stackexchange.com/a/6154/293 as well.
> 0 votes

# Answer
Much earlier, I did it for Channel Entry Form and FreeForm by developing an extension. On submitting the form, the extension generate PDF (with TCPDF/FPDF) and that generated PDF will be sent as attachment to provided email address.

This process seemed me pretty simple and did everything.

I hope, this approach would help you. Please let me know if I can share more idea.
> 0 votes

---
Tags: email, forms, html-email
---


# Question
Title: Previewing content on site before going live
I'm currently looking for a neat way to preview content before it gets set live. The ideal setup would be to have a status "draft" that is shown on the frontend to super-admin and maybe other CMS user groups if setup.

I've played with the live look feature but I think it would be nicer to switch the status parameter in the tags depending on the user logged in group\_id.

The problem I have come up against is the parsing order.

This post looks like its doing exactly what I want http://themetaq.com/articles/a-better-way-to-preview-entries-in-expressionengine but couldn't get this to work.

I want to keep this as out of the box as possible, rather than a using an add-on.

Thanks!

# Answer
> 1 votes
\[Edited\]

If you are using Low Variables (or some other add-on) that allows global variables to be parsed early, you can do this...

--ORIGINAL POST--

The way to do this without an add-on is to use a snippet with simple conditionals.

Create a snippet `sn-statuses` with:

```
{if logged_in_member_id == "1"}Open|Draft{/if}
{if logged_in_member_id != "1"}Open{/if}

```

Then, in your template, pull in the snippet:

```
{exp:channel:entries channel="my_channel" status="{sn-statuses}"}

```

# Answer
> 1 votes
I prefer to always work without add-ons, if I can.

I use to create a snippet with this code and put it inside the `exp:channel:entries`:

```
{if status !="open" OR entry_date > current_time}
    {if author_id != logged_in_member_id AND logged_in_group_id != 1}
        {redirect="404"}
    {/if}
{/if}

```

If `open` isn't the only status the users can see, you can improve the code:

```
{if status != "open" && status != "featured" OR entry_date > current_time}
    {if author_id != logged_in_member_id AND logged_in_group_id != 1}
        {redirect="404"}
    {/if}
{/if}

```

I prefer to check for `status` that are different for the open ones because, sometimes, a new one can be created and maybe it shouldn't be viewed yet.

# Answer
> 1 votes
**The Stash method.**

(I know you want an add-on-free version, but why? Stash is free, supported, and helps with performance.)

Toward the top of your template set the statuses based on the group\_id of logged in member.

```
{exp:stash:set name="statuses"}{if group_id == "1" || group_id == "6"}open|draft{if:else}open{/if}{/exp:stash:set}

```

Then get that variable in your channel entries tag pair.

```
{exp:channel:entries status="{exp:stash:get name='statuses' parse_tags='yes' parse_conditionals='yes'}" channel="my_channel" dynamic="no" parse="inward"}
  {exp:stash:set_list name="blog_listing" parse_tags="yes"}
   ....

```

# Answer
> 0 votes
I have developed a small add-on for this. It essentially creates/turns some user variables into early global config vars

> This extension adds logged\_in\_member\_id and logged\_in\_group\_id to the global variables array so they are parsed early and can be used in simple conditionals.

```
  {if logged_in_member_id != "0"}
    {exp:channel:entries status="open|members_only"}
    ...
    {/exp:channel:entries}
  {/if}
  {if logged_in_member_id == "0"}
    {exp:channel:entries status="open"}
    ...
    {/exp:channel:entries}
  {/if}

```

> If you rely, for some reason, on logged\_in\_member\_id being parsed late, the extension also adds global\_member\_id and global\_group\_id for convenience.

http://devot-ee.com/add-ons/global-member-vars

---
Tags: channel-entries, status
---


# Question
Title: Setting up Git version control for a multi-environment workflow
I've got a live EE site and I need to put it under version control using multi-environment config settings.

My goal is to set a git workflow, so these would be the steps I believe are right for my needs: I just want to track templates, css, js and html changes.

STEPS:

1 - Using SFTP, download all production files to my local machine

2 - Dump a production SQL database.

3 - Then, on my local machine I make a fresh install of ExpressionEngine, using the same EE version as the live site.

4 - I put in place Focuslab config settings for local, staging and production.

5 - Add all production files to my local web root

6 - Import the dumped database

7 - Site is ready in local.

8 - Then, I add .gitgnore to ignore all upload images, media and cache.

9 - Git init

10 - My local site is ready.

11 - Then, I go to the staging server to create the staging site just by repeating 3, 4, 5 and 6 steps.

12 - Now, on local I will be able to test addons, for instance, and git push them to the staging site.

TWO QUESTIONS:

* On the production server I should modify config to use the Focuslab config settings?
* I guess, even though I'm not tracking uploaded content, I still have to synchronise production database with the local db, every time I make a change in local, like using a new addon?

Any ideas?

# Answer
> 16 votes
*I'll add to this as needed.*

Since you have ssh access to the server, start there.

**1)** Connect via ssh to the production server via Terminal (or iTerm app). `cd` to the root of your site (or the directory where you want to track changes).

---

**2)** Type the following:

`git config --global user.name "SITE NAME Prod Server"`
`git config --global user.email johndoe@example.com` use company or your email
`git init`
`git add .`
`git commit -am "initial commit, all files added"`

Now you have your site files tracked on your production server. For good practice (and ease), next you'll set up a central repo "hub". (See comments below for some thoughts on this.)

---

**3)** Sign up for Bitbucket (or pay for GitHub). Note: you can't put an EE site on a public repo.

---

**4)** Back on your production ssh connection, create an ssh public/private key pair.

Type
`cd ~`
`ssh-keygen -t rsa -C "your_email@example.com"`
Follow step 2 of GitHub's helpful instructions: https://help.github.com/articles/generating-ssh-keys#step-2-generate-a-new-ssh-key

---

**5)** Copy your key to your computer's clipboard from Terminal

Type
`pbcopy < ~/.ssh/id_rsa.pub`

---

**6)** Add this key to Bitbucket so you can push to their server. See how: step 6 here.

---

**7)** Create an empty repo on Bitbucket.

---

**8)** Now let's connect your server's repo to your new Bitbucket repo. Back in Terminal, type:
`cd /path/to/your/project`
`git status` \- make sure you are actually in your repo
`git remote add origin https://USERNAME@bitbucket.org/USERNAME/MY-REPO.git` \- Use your Bitbucket username and repo short name.
You should see it processing to send the files. After it's done, check Bitbucket and make sure your source files are there now.

---

**9)** Pull the repo to your local machine (or staging/dev server). Grab the ssh clone command from Bitbucket for your repo (it will be something like `git clone git@bitbucket.org:USERNAME/MY-REPO.git`).
Using terminal, go to your local machine's (or staging/dev server's) directory where you want to add the site files. Note that this will create a root folder, so I usually name my repo folder 'public\_html\`.

Type your clone command:
`git clone git@bitbucket.org:USERNAME/MY-REPO.git public_html`

---

**10)** To be able push to Bitbucket from your local machine (or staging/dev server), follow steps 4-6 for your local machine (or staging/dev server).

From here, you are connected from local to production.

---

**11)** Add a .gitignore file to your local root directory (in this example, /public\_html/.gitignore) to ignore all upload images, media and cache (and whatever else you don't want to track). Don't ignore the .gitignore file because you want it added to your other environments too.
Example .gitignore file for EE.

If you find that your newly ignored files are still being tracked, try this:

`git commit -am "your commit message"` (you need to first commit current changes)
`git rm -r --cached .`
(Or if you just want to cherry pick a file: `git rm --cached path/to/file/to/ignore`)
`git add .`
`git commit -m "fixed untracked files"`

---

**12)** Add Focus Lab's EE master config (follow their instructions) paying special attention to set the correct *production* and local database info.

If you have a team and each developer will be working on the site with his/her own local database, it is helpful to make a copy of config.local.php (rename to EXAMPLE.config.local.php), then ignore config.local.php so the local db settings are not committed and pushed.

---

**13)** Export your live site's database and import it into your local site's database.
Do whatever other steps you may need to get your local site running properly. Sync upload directories and/or templates in EE, as needed.

You should be running an exact copy of your live site now.

---

**14)** Once you have your local site running with the Master Config, commit those changes.
`git commit -am "message describing changes for this commit"`

---

Make changes locally, commit, push (`git push origin master`). Then pull from your server via ssh connection (`git pull origin master`) when you're ready to make those changes live. Or setup an auto-deploy hook/action for your server. Any database changes you make locally will have to replicated on the live site, so make careful note of them!

---
Tags: focus-lab-master-config, git, workflow
---


title: FreeForm Pro Composer require field

text:
# Question
Title: FreeForm Pro Composer require field
How do I make a field require with the new composer? in the past I would create the form and include:

`{exp:freeform:form require_captcha=“yes” required="name|email"}` (which still work on the site).

With the new composer forms I try to do it the same way and I am not getting an indication to required fields.

`{exp:freeform:composer form_name="contact-form" composer_template_name="general_template" required="name|email" require_captcha=“yes”}`

Any ideas?

# Answer
When you are building composer forms, in the bottom left hand corner of each field is a widget where you can toggle required:

It also seems that you are forcing a composer template, you can do that in the upper left hand corner of composer:

Unless you need specific overrides, the composer tag was designed to only really need to have the form name or id:

```
{exp:freeform:composer form_name="contact-form"}

```

Thats not to say what you are doing with the tag is *wrong* just more work than you have to be doing.
> 2 votes

---
Tags: solspace-freeform
---


title: Expresso Store - Stripe Payment Issue

text:
# Question
Title: Expresso Store - Stripe Payment Issue
I have a template that submits to stripe and gets back a 200 and a token through store.

But when the token comes back, I am getting no 'complete the order process' at all. The template doesn't submit and no error shows. I get no order in Store control panel, and no purchase call for stripe.

Can you shed some light on this?

https://gist.github.com/emagine/7248059

# Answer
When you have a form that is not submitting you should always remove `error_handling="inline" error_delimiters='<span class="help-inline">|</span>'` from your template to see if you have any errors being reported that are not templated.

Having said that if you are trying to register a member during the checkout process you need to include both a `password` and `confirm_password` field in your template at this point.
> 2 votes

---
Tags: expresso-store, stripe
---


# Question
Title: Assets Unable to Connect to S3: Access denied by target host
I'm getting an "Access denied by target host" error when attempting to connect to S3 with Assets.

In order to troubleshoot further, I've added a var\_dump around line 238 in third\_party/assets/sources/s3/lib/S3.php:

```
        if ($rest->error !== false)
        {
            self::__triggerError(sprintf("S3::listBuckets(): [%s] %s", $rest->error['code'],
                $rest->error['message']), __FILE__, __LINE__);

                var_dump($rest);

            return false;
        }

```

When attempting to refresh the bucket list in Assets via the EE control panel, I can now see the details of the error:

```
object(stdClass)#162 (3) { ["error"]=> array(2) { ["code"]=> string(12) "AccessDenied" ["message"]=> string(13) "Access Denied" } ["code"]=> int(403) ["headers"]=> array(1) { ["type"]=> string(15) "application/xml" } } Access denied by target host.

```

Summary: Amazon's response is "Access Denied"

I thought my credentials may have been to blame, but, editing either key changed the error message, so, that wasn't the problem in this instance.

Using the OS X file transfer app Transmit, I was able to connect to S3 with the same credentials, list files, upload a file, and then view it via the publicly accessible URL, so that ruled out configuration/policy issues on Amazon's end.

Upon further testing with Transmit, I found that I could get the same "Access Denied" error if I omitted the "path" (which is the same thing as the bucket name) setting when I attempted to connect - it appeared that our policy of not allowing the user to perform a list-buckets command was the problem. Is it possible to hard code the bucket name somehow?

# Answer
> 1 votes
Assets recently added support for setting bucket names in config.php, like this:

```
   $config['assets_source_settings'] = array(
      1 => array (
        'access_key_id' => 'key-id-goes-here',
        'secret_access_key' => 'secret-key-goes-here',
        'bucket' => 'bucket-name-goes-here'
      )
    );

```

That by itself should be sufficient to get past an S3 policy that doesn't allow listing buckets.

# Answer
> -1 votes
I think the issue is perhaps with your server time. It's the solution to the top two Google results for this error at least:

https://forums.aws.amazon.com/message.jspa?messageID=449702#

and

Assets stopped connecting to Amazon S3, Access denied by target host

---
Tags: assets, s3
---


title: Logged in members - account sharing

text:
# Question
Title: Logged in members - account sharing
Is there a way to see whether a currently logged in user account is being used on more than one machine concurrently? I'm trying to find out whether users are sharing their usernames/passwords, as I manage a site that requires payment to access certain content.

I'm using the cookies only user session type. I have looked at using the 'Allow multiple log-ins from a single account?' option to prevent sharing but this caused issues when genuine users tried to access the site using multiple devices.

# Answer
> 3 votes
You can query the `exp_sessions` table, where you can see both the `ip_address` and `member_id` for each session. Multiple sessions from wildly different IPs would be a cue that an account was being shared widely.

---
Tags: members, login, sessions, cookies, member-management
---


# Question
Title: Wygwam field with sub-domains - Can't insert media from YouTube
ExpressionEngine v2.7.1 - Build Date: 20130924 Wygwam 3.1.2

If I create a new entry, I am able to click on the "Embed Media" button in the toolbar and paste the YouTube provided embed code, click "Save" and the video inserts without issue.

However, if I edit that entry, or edit another entry and attempt to insert a video in another location, I click the "Embed Media" button in the toolbar and paste the YouTube provided embed code, click "Save" and nothing happens.

In the console window, (Chrome), I get the following:

```
Uncaught SecurityError: Blocked a frame with origin "http://admin.domain.com" from accessing a frame with origin "http://domain.com". Protocols, domains, and ports must match.        ckeditor.js:876

```

In IE script error window I get:

```
SCRIPT5: Access is denied.        ckeditor.js, line 876 character 99

```

I don't understand why it works the first go, but not the edit.

# Answer
> 1 votes
This was due to an error being triggered from the frame being used on NSM Live Look and permission settings. When I disabled the NSM Live Look add-on, everything worked smoothly. I am trying to resolve this issue further by seeing if there is something I can do with the NSM Live Look scripts, but I haven't received any responses from the developer yet.

---
Tags: ee2, wygwam, subdomain, embed-media
---


title: Matrix field blowing up after 6 columns

text:
# Question
Title: Matrix field blowing up after 6 columns
If I create a matrix field with 5 columns, I am fine. However, if I create one with 6 or more, I am locked out of editing custom field types. I don't see any errors. No CP errors are triggered and the data remains in the db. I cannot, however, go edit the field type to modify or remove the extra field in the matrix. I have to edit the db table and forcefully remove it from the table. After doing this, I can once again edit the fieldtype and rebuild it without the last addition. I have run into this a few times on older sites. I haven't had the need for that many matrix columns on anything in EE2 yet so I don't know if this extended to that or not. Has anyone else run into this before?

I am running EE 1.6.8 on the sites this has happened on.

# Answer
> 0 votes
I worked with Brandon on this via email and we updated everything to the newest versions. This still did not resolve the issues. I am fairly certain this issue is due to the way this old site was built and maintained. I was able to correct the issues I was having by reverting all the way back to the older FF Matrix fieldtype.

I am in the process of a complete rebuild and will be moving it all into EE2 so this should "disappear". I will set this as answered, if nothing else to remove it from the radar of unanswered questions.

# Answer
> 0 votes
Just guessing, but if the Matrix field is somehow getting blown-up by the columns you're adding, it may be blowing-up the Matrix Javascript and/or EE CP Javascript, which then prevents you from editing the field.

When you try to edit fields, in what way are you "locked out"? Take a look at your browser's Javascript console, and look for errors that arise at the point where you're stuck.

Also, what version of Matrix are you using? If it's less than FF Matrix 1.3.5, you may want to upgrade to 1.3.5.

---
Tags: matrix, pixelandtonic, ee1
---


title: Playa field explodes Matrix field

text:
# Question
Title: Playa field explodes Matrix field
I have an issue with an old build.

EE 1.6.8 - Build 20090723 Matrix 2.0.11 Playa 3.1.2

I create the matrix field fine, but if I add a playa segment, after saving the field, I can no longer access the field. If I click on the field label to edit it, I am shown nothing but an Update button. I can not edit the field in the entry template either. I need to get this fixed until I get everything rebuilt and updated to 2.

# Answer
I worked with Brandon on this via email and we updated everything to the newest versions. This still did not resolve the issues. I was able to correct the issues I was having by reverting all the way back to the older FF Matrix fieldtype. This is the same solution I had to apply to another issue I was having which leads me to believe this issue is due to the way this old site was built and maintained.

I am in the process of a complete rebuild and will be moving it all into EE2 so this should "disappear". I will set this as answered, if nothing else to remove it from the radar of unanswered questions.
> 0 votes

---
Tags: matrix, playa, pixelandtonic, ee1
---


# Question
Title: Wygwam Embeds being Removed on Edit Entry
Trying to embed a javascript embed, like from Survey Monkey, into a Wygwam 3.2.1 field and when the entry is edited and saved, the embed is removed. Any ideas?

# Answer
I figured it out. I needed to set **Restrict allowed HTML?** to 'No' in the Wygwam configuration settings. This is located on the WYGWAM Module settings page. Works as expected now.
> 4 votes

---
Tags: wygwam
---


title: {birthday} is not showing

text:
# Question
Title: {birthday} is not showing
I'm using Solspace's User add-on and I want to show a simple list of all registered members:

```
{exp:user:users group_id="5"}
<tr>
    <td>{screen_name}</td>
    <td>{email}</td>
    <td>{birthday}</td>
</tr>
{/exp:user:users}

```

However, the birthday just prints {birthday} as if the tag isn't recognized. The other two print just fine.

I have no clue as to what causes this. Anyone?

# Answer
> 5 votes
When a variable is returned, instead of echoing out your data means that it isn't an associated variable.

In the Solspace User docs, it uses the variable {bday\_d}. Try that, but there are more for the birthday, so check them out.

---
Tags: members, solspace-user
---


# Question
Title: Display Custom User Fields in Profiles (Group ID)
We are using User 3.4.4. We want the Group\_ID (Member Group) that is selected on the Register form to be displayed somewhere on the Profile (as a custom field?) Is this possible?

# Answer
> 2 votes
If I understand correctly, the `{member_group}` single variable will show the member group ID for the currently logged in user

### Update

I would create a new member custom text field to capture this data on registration. So during the registration process, have this text field hidden and then with Javascript copy the value from the Member Group field to this hidden text field. Make sense?

### Update 2

Updated Kristen's fiddle for demo purposes. Added comments and optimized the function a little bit. ID selector's are always faster. Thanks Kristen for creating that fiddle. Here is the updated one

---
Tags: solspace-user
---


# Question
Title: Using {switch} to Repeat Divs at Intervals
I have a loop of entries using a playa field to show multiple entries. I would like certain formatting to happen every 3 intervals. I found what I believe to be the solution to my issue here: https://stackoverflow.com/questions/13050550/how-can-i-insert-html-at-repeating-intervals-in-expressionengine

But something isn't working right. When I look at the result of my loop, there are too many closing divs. It looks like my opening switch statement is working the way i'd like, but the closing switch statement is incorrect. Could someone tell me what I'm doing wrong?

**Here is the code in my template:**

```
{playa_field show_future_entries="yes" show_expired="yes"}
    {switch="<div class='section-box add'><div class='outer-center'><div class='inner-center'>||"}
        <div class="box2">
            <img src="{event_banner_small}" width="336" height="196" alt="{title}" />
        </div>
    {if row_count != total_rows}{switch="||</div></div></div>"}{/if}
    {if row_count == total_rows}</div></div></div>{/if}
{/playa_field}

```

**Here are the results in the browser:**

```
    <div class='section-box add'>
    <div class='outer-center'>
    <div class='inner-center'>
        <div class="box2">
            <img src="http://www.example.com/img.jpg" width="336" height="196" alt="example" />
        </div>
    </div>
    </div>
    </div>
        <div class="box2">
            <img src="http://www.example.com/img.jpg" width="336" height="196" alt="example" />
        </div>
    </div>
    </div>
    </div>
        <div class="box2">
            <img src="http://www.example.com/img.jpg" width="336" height="196" alt="example" />
        </div>
    </div>
    </div>
    </div>
    <div class='section-box add'>
    <div class='outer-center'>
    <div class='inner-center'>
        <div class="box2">
            <img src="http://www.example.com/img.jpg" width="336" height="196" alt="example" />
        </div>
    </div>
    </div>
    </div>
        <div class="box2">
            <img src="http://www.example.com/img.jpg" width="336" height="196" alt="example" />
        </div>
    </div>
    </div>
    </div>

```

**Here is what I would like the outcome to be** (lets say the total results are 5 in this case, but this number could be more or less depending on the channel entry):

```
     <div class='section-box add'>
     <div class='outer-center'>
     <div class='inner-center'>
            <div class="box2"> <!--entry 1-->
                <img src="{event_banner_small}" width="336" height="196" alt="{title}" />
            </div>
            <div class="box2"> <!--entry 2-->
                <img src="{event_banner_small}" width="336" height="196" alt="{title}" />
            </div>
            <div class="box2"> <!--entry 3-->
                <img src="{event_banner_small}" width="336" height="196" alt="{title}" />
            </div>
     </div>
     </div>
     </div>
     <div class='section-box add'>
     <div class='outer-center'>
     <div class='inner-center'>
            <div class="box2"> <!--entry 4-->
                <img src="{event_banner_small}" width="336" height="196" alt="{title}" />
            </div>
            <div class="box2"> <!--entry 5-->
                <img src="{event_banner_small}" width="336" height="196" alt="{title}" />
            </div>
     </div>
     </div>
     </div>

```

# Answer
Looks like I got it working. maybe this will help someone else out, or maybe someone will find an even better solution. I simply switched

{if row\_count != total\_rows} & {if row\_count == total\_rows}

to

{if count != total\_results} & {if count == total\_results}

**so the final code in my template is:**

```
{playa_field show_future_entries="yes" show_expired="yes"}
    {switch="<div class='section-box add'><div class='outer-center'><div class='inner-center'>||"}
        <div class="box2">
            <img src="{event_banner_small}" width="336" height="196" alt="{title}" />
        </div>
    {if count != total_results}{switch="||</div></div></div>"}{/if}
    {if count == total_results}</div></div></div>{/if}
{/playa_field}

```
> 3 votes

---
Tags: playa, loop, switch, interval
---


# Question
Title: Relationships - can I get child channel_short_name?
I have a relationship field where the parent can select multiple children from multiple channels. When it comes time to display everything, I need to know what channel the child entry comes from so I can display the proper fields.

I tried:

```
{parent}
{parent:channel_short_name} - <b>{parent:title}</b><br />
{/parent}

```

but no go. It literally just displays "{parent:channel\_short\_name}".

Any ideas? Just go get Playa?
Thanks
Amanda

Edit: Haha, yea never mind. I must have had a typo. It works fine.

# Answer
This example in the docs suggests that your code should be:

```
{parents}
{parents:channel_short_name} - <b>{parents:title}</b><br />
{/parents}

```

Hopefully this helps.
> 3 votes

---
Tags: relationships
---


title: EE 2.7 Comments defaulting to Open

text:
# Question
Title: EE 2.7 Comments defaulting to Open
I'm trying to build out a blog in EE, and even though i'm still a bit confused by some things my biggest issue is that all posted comments via {exp:comment:form} default to open.

So i have a channel called "our\_blog" and below are it's preferences.

* Allow comments in this channel? **Yes**
* Require membership in order to post comments? **No**
* Require email address to post comments? **No**
* Moderate Comments? **Yes**

So i assumed, that having it set to "Moderate Comments" would mean that all comments posted to this channel entries would be defaulted to either closed or pending. But for whatever reason they keep defaulting to open, so as soon as someone posts a comment it shows up on the front-end. This is a no-no!

This is my form

```
{exp:comment:form channel="our_blog"}
      <label for="name">Name:</label> <input type="text" name="name" value="" size="50" />
      <label for="email">Email:</label> <input type="text" name="email" value="" size="50" /><br /><br />
      <label for="comment">Comment:</label><br />
      <textarea name="comment" cols="70" rows="10">{comment}</textarea><br /><br />
      {if captcha}
          <label for="captcha">Please enter the word you see in the image below:</label><br />
          <p>{captcha}<br />
          <input type="text" name="captcha" value="{captcha_word}" maxlength="20" /></p>
       {/if}
       <input type="submit" name="submit" value="Submit" />
{/exp:comment:form}

```

I've googled and googled, but to no result! Thanks for any help and advice in advance!

# Answer
> 1 votes
If the members who is testing the comments are in the group super-admins or another one which has been set to exclude its members from the comment moderation, the status of their comments will always be `open`.

---
Tags: ee2, comments, comment-form
---


# Question
Title: Code to change the input class when the field is "required"
I am trying to figure out the code that will allow me to change the class of the input field when the field is required. I have created css that will change the field color and can't figure out how to set this up correctly in the new FreeForm composer template.

I have set this up to add "\* required" on the field name:

```
<label class="field_label" {if composer:field_name != ''}for="freeform_{composer:field_name}"{/if}>
        {composer:field_label}
        {if composer:field_required}<span class="required_item" style="font-size: 0.9em"><i>* required</i></span>{/if}
</label>

```

# Answer
> 3 votes
Best way to do this is to add the class to a containing element like this:

```
<div  {if composer:field_required}class="required"{/if}>
    <label></label>
    <input>
</div>

```

Then target the input field with css like this:

```
.required input {
    border: 1px solid red;
}

```

---

You can also use this for your "\* required" copy... Change

```
{if composer:field_required}
    <span class="required_item" style="font-size: 0.9em">
        <i>* required</i>
    </span>
{/if}

```

to

```
<span class="required_item" style="font-size: 0.9em">
    <i>* required</i>
</span>

```

And set CSS to this:

```
.required_item {
    display: none;
}
.required .required_item {
    display: block;
}

```

---
Tags: solspace-freeform
---


# Question
Title: Blank pages for front and back end in EE 1.x
I'm trying to recreate an EE1 site locally on my Mac with MAMP and am getting blank pages on both front end and back end after logging in (can see login page OK before logging in though).

I've checked error logs and the only error that's coming up is *Unable to parse XML data*.

DB credentials are correct because if I change them I get the 'can't connect to the db' error message.

I've manually emptied cache folders and have tried changing PHP versions.

Any other steps I can take to figure out what's going on?

# Answer
In my experience a white screen is always a suppressed PHP error. If you can't get the error to show, something is still suppressing it.

Instead of going back and forth with comments, we jumped on Skype. In this case, disabling extensions in the config.php file got the PHP error to show up on the screen. This is an EE1 site so we used:

```
$conf['allow_extensions'] = "n";

```

It turns out a Cartthrob directory was missing and was throwing a fatal PHP error.

My theory on why php errors continued to be suppressed even when forcing them to show in the index.php file is that one of the extensions was disabling them afterwards. This explains why they weren't showing on screen or in the php log file until extensions were disabled.
> 1 votes

---
Tags: ee1, blank-screen
---


# Question
Title: Solspace Calendar module timezone entry field empty
When I go to add a Calendar, the timezone entry field doesn't show up and when I go to add Events, the event date picker doesn't show up.

It all worked fine locally, but not on the live site.

I'm using EE version 2.5, Solspace Calendar 1.8.5

Please help!

# Answer
> 1 votes
Sound like the theme files didn't get uploaded to the production server fulling. I suggest you delete the Solspace Calendar theme directory which should be located at /themes/third\_party/solspace\_calendar (or something like that)... then reupload the theme directory. If that doesn't get it working, also reupload the module files.

---
Tags: solspace, calendar, timezone
---


# Question
Title: Fedex errors on shipping method, whether it's set to Test mode or not
I'm trying to set up two Fedex shipping methods in Expresso Store. I've set up a Fedex API account and have added the API Key, Password, Account number and Meter number that Fedex gave me. However, I always just receive the error "Meter number is missing or invalid.", even if I set the test mode to True.

Anyone know what I'm doing wrong? The meter number is definitely the one that Fedex gave me, with no hidden spaces or any other mistakes. I'm running Store 1.6.0 on EE 2.3.0

# Answer
This was a bug fixed in Store 1.6.3.

* Fixed multiple issues and improved error handling of the FedEx shipping plugin (v1.6.2)
* Fixed a FedEx shipping driver error message when weights were stored as metric units in Store (v1.6.3)

https://exp-resso.com/docs/release\_notes.html#store\_163
> 1 votes

---
Tags: add-on, expresso-store, shipping
---


# Question
Title: generating a report for all orders with all information expresso store
I have one product with several modifiers. You can either pay offline for this product or pay online through paypal. I'm capturing various data from the form that the user fills in. Now I want to pull a report on **all** the orders that have been processed so far with **all** the details, such as product sku, customer name, address etc.

My problem is when I try to pull a report using 'orders report', it only shows those orders which have been **paid**. How do I show all orders no matter if they were paid or not?

Thanks

# Answer
> 1 votes
The orders report should show all "completed" orders, regardless of whether they are paid or not.

If the built in reports aren't flexible enough for you, you can generate your own reports using the orders tag. So it might be a good idea just to create your own custom report.

---
Tags: expresso-store
---


# Question
Title: Extending Exp:resso Store for member categories: Right ideas? Which hooks?
The site I will be building soon will require permissions for various parts of the site, documents, videos, etc. I am planning on using Zoo Visitor & Categories to simulate multiple member groups. I'm planning to use Exp:resso Store to somehow be the means of purchasing products and applying categories of the products to the member, too, upon purchase.

Has anything like this been done? If not, what hooks would I use to check a product's category/categories so I might apply it to a member?

Also the price of a product may be dependent on permissions/products the member already has, so say if they have Product A, they can get Product B at a discounted price, or if they have any number of the following products they automatically get Product X. To accomplish this and other types of discounts I'm thinking of using another Channel (e.g. a "Price Modifier Channel") that links products together via Playa fields and a field with the discount type/value. At some point a custom add-on will go through all related entries of a product to see if any discounts are applicable, if so, apply them (price modifiers can be made up on the fly, right?).

I just wanted to see if I've got the right idea to proceed with, regardless, I'm open to suggestions.

Also it's not very clear which of Store's hooks I'd be using to do any of these things. I guess since the template is in charge of presenting the product along with price modifier it could just be in the custom add-on itself via a module, no need for hook?

Sorry I couldn't be any more brief/specific, not my forte. Thanks.

# Answer
If you want to make changes to a member after an order has been placed, the best hook to use is `store_order_complete_end`:

https://exp-resso.com/docs/extension\_hooks.html#store\_order\_complete\_end

This runs when an order is "completed", which means it was either paid in full or paid with the manual payment gateway (either way, it stops becoming a cart when it is completed).

If you want to edit the price of items depending on the current user, there are various ways of approaching this. The easiest way would be to use the `store_order_item_recalculate_end` hook, which runs inside the cart when the cart is updated. There you are able to adjust the price of the item.

https://exp-resso.com/docs/extension\_hooks.html#store\_order\_item\_recalculate\_end
> 1 votes

---
Tags: expresso-store
---


title: Expresso Store Reports Not Working

text:
# Question
Title: Expresso Store Reports Not Working
It appears that reporting is not quite working. On several of my sites I have noticed the reports barely work, crash, and/or just go back to the cp home. This is on both "view" and "pdf". I can't get the dates to really work right either. Is this a known limitation, or am I doing something wrong on my side?

Brad

# Answer
Generally the Store reports are fairly memory hungry. If you have your memory limit very low, try raising it to at least 128mb (256mb or 512mb is preferable - on todays servers memory is cheap).

Another problem people often run into with the reports page is to do with EE's secure forms feature. If you have secure forms enabled, then using the browser back button will not work correctly in your control panel. If you generate a report, then click back, then try to generate another report, you will get an error, or be redirected back to the CP home page. The best solution to this is simply to disable EE's secure forms feature under Admin \> Security & Privacy \> Security & Sessions \> "Process form data in Secure Mode?".
> 1 votes

---
Tags: expresso-store
---


title: Expresso Store PHP Error with reports

text:
# Question
Title: Expresso Store PHP Error with reports
I'm getting a PHP error when generating reports. Any idea what this means?

EE 2.5.3 w/ Expresso Store 1.6.2 / IIS 7 / PHP 5.3.6

```
Severity: Warning
Message: Invalid CRT parameters detected
Filename: store/mcp.store.php
Line Number: 2248

```

# Answer
> 1 votes
This is a bug in Store which only appears on servers running Windows/IIS. It is to do with PHP handling date formatting differently on Windows.

It will be fixed in the next version of Store.

---
Tags: expresso-store, expresso
---


# Question
Title: Using the product form tag and javascript to duplicate a product modifier field
Im building a ticketing system with expresso store and I'm having issues duplicating the product modifier. My custom modifier is a text input field that adds a name to each ticket. Any Ideas on what would be the best way to go about this?

here is my product template:

```
    {embed="store_example/_header"}
<script type="text/javascript">
function repeat(obj) {
    var CurrentLi = $(obj).parent("li").append();
    CurrentLi.clone().insertAfter(CurrentLi);
}
</script>
{exp:store:product_form }
<div class="ticket-wrap">
    {exp:channel:entries channel="tickets"  }
        {exp:store:product entry_id="{entry_id}" disable_form="yes"}
        <p>Ticket Price: {price}</p>
        <div class="ticket">
            {modifiers}
                <ul>
                    <li><label>{modifier_name} {count} </label><input type="text"  name="items[{count}][{modifier_input_name}]" /> <a class="add" href="#" onclick="repeat(this)">+</a></li>
                    <li><input type="hidden" name="items[{count}][entry_id]" value="{entry_id}" /></li>
                </ul>
            {/modifiers}
        </div><!-- /ticket -->
        {/exp:store:product}
    {/exp:channel:entries}
</div> <!-- /ticket-wrap -->
<input type="submit" name="submit" value="Add to Cart" />
{/exp:store:product_form}
{embed="store_example/_cart"}
{embed="store_example/_footer"}

```

# Answer
> 2 votes
You can't simply submit extra modifiers which weren't specified when you created the product.

If you want to submit custom text fields with the product, you need to specify them in your product tag. This is known as "custom product modifiers":

https://exp-resso.com/docs/product\_tag.html#inputcustom\_modifier\_name

---
Tags: expresso-store, ecommerce
---


# Question
Title: Multiple Dynamic Product Variables not working?
I am using espresso-store 1.6.2, and working with the product modifiers. I've managed to get the dynamic product variable working for my price & sku in the main area (code below).

```
<div class="price_box">

      <h3><span class="store_product_price">{price}</span><span class="ft">{per_unit}</span></h3>

      <h4 style="text-decoration:none; font-size:13px;">Sku: #<strong class="store_product_sku">{sku}</strong></h4>

                     {modifiers}
    <hr>
                         <label>Options: {modifier_name}</label><br/>
                            {if modifier_type == 'var' OR modifier_type == 'var_single_sku'}
                            <form class="store_product_form">
                            <select name="{modifier_input_name}" class="select" style="width:100%;">
                              {modifier_options}
                                <option value="{option_id}">
                                  {option_name}
                                  {if price_mod_val} {price_mod} {/if}
                                </option>
                              {/modifier_options}
                            </select>

                          {if:else}
                            <input type="text" name="{modifier_input_name}" />
                          {/if}
                          </form>

                    {/modifiers}

</div>

```

But when I try to use the `<span class="store_product_price">{price}</span>` anywhere else on my site it doesn't work, I can use it multiple time but only within the "price\_box" div.

I guess i'm just wondering if you can only use the Dynamic Product Variables css classes only once?

Thanks in advance!

# Answer
> 1 votes
I'm not sure exactly what the rest of your template code looks like, but there is certainly no limit on the number of times you can use the dynamic css variables like `store_product_price` in your template.

One caveat to remember is that they will only work inside your `{exp:store:product}` tag. So you won't be able to display them outside of the product tag.

---
Tags: expresso-store, dynamic
---


# Question
Title: Overwrite Value of Default Region for Exp:resso
I'm having issues with overwriting the value of the billing and shipping region fields as they are taking on the default value set in the Region/Country area of the Store setup.

I am using Store with Zoo Visitor and I thought that, like all other fields, if the billing/shipping region fields had a value, that is what would be outputted. However, for me that is not the case, it is only outputting the default value even though the fields in the entry have values.

Can anyone shed some light on why this is?

Thanks, J

EDIT: The current code is:

```
<select name="billing_region" class="state billing_state customDrop"><option {if billing_region == ''}selected {/if}value="">--State--</option><option {if billing_region == 'ACT'}selected {/if}value="ACT">ACT</option><option {if billing_region == 'NSW'}selected {/if}value="NSW">NSW</option><option {if billing_region == 'QLD'}selected {/if}value="QLD">QLD</option><option {if billing_region == 'VIC'}selected {/if}value="VIC">VIC</option><option {if billing_region == 'TAS'}selected {/if}value="TAS">TAS</option><option {if billing_region == 'SA'}selected {/if}value="SA">SA</option><option {if billing_region == 'WA'}selected {/if}value="WA">WA</option><option {if billing_region == 'NT'}selected {/if}value="NT">NT</option></select>

```

However, {billing\_region} is just outputting the default region. We have set a default country (AU, Australia) and the default region is set to nothing at the moment after trying to display the current region with and without a default.

# Answer
> 1 votes
I found some interesting behaviour for example in some instances, if I were to print the value of the billing\_region separately into a div rather than set the value in the dropdown, the correct region would be selected in the dropdown.

But I have since got it to work. I changed back the fields we were using to just plain text fields, rather than a select field. It shouldn't have affected anything since the values for the field were the same, and the select in the Admin CP was displaying the correctly selected value. It still doesn't explain why it wouldn't select the correct value in the select.

Nevertheless, I have my fields working correctly, and changing from a select to a text input is not a big deal for us for our project.

# Answer
> 1 votes
When you are testing the default country/region settings, be sure to clear your cart between each test.

As the fields only apply to new carts, the current value will remain in your cart until you click "Empty Cart" or delete all items from your cart.

In addition, make sure you don't have mapped member fields interfering with your default country/region. If you have mapped these fields to member fields, then the member's currently stored country/region will take priority over the site-wide default country/region.

---
Tags: expresso-store, expresso
---


# Question
Title: disable "update cart" button and reenable when a user changes the quantity?
I know it's not really expresso-store related, but I hope that one of you girls can share some javascript magic to make this possible.

I want the "update cart" button to be disabled until a user changes the amount on the checkout page. to give the user a better clue of what she should be doing.

any help appreciated! cheers stefan

# Answer
You can just do this with vanilla jQuery.

Set the update cart button as disabled by default:

```
<input type="submit" name="update_cart" value="Update Cart" id="store_update_cart" disabled />

```

Then make your item quantity fields have a class you can use to target them:

```
<input name="items[{key}][item_qty]" value="{item_qty}" class="store_item_qty" />

```

And use jQuery to enable the button when the value changes:

```
$(function() {
    $(".store_item_qty").update(function() {
        $("#store_update_cart").attr('disabled', false);
    });
});

```
> 2 votes

---
Tags: expresso-store
---


# Question
Title: Passing on a 1% credit card fee using Expresso Store
We have a client who needs to add a 1% surcharge to online credit card orders only.

We've been fudging it via tax but that is only temporary as it won't allow us to control whether it is applied or not.

I have a feeling that we might need to manage it via Hooks but that is new territory for me. If any one has solved this problem or has some advice as to where to start I'd be grateful.

Cheers, Sean

# Answer
> 1 votes
It's not possible to do this natively using Store.

The best way to do it would be to write an extension using the `store_order_recalculate_end` hook:

https://exp-resso.com/docs/extension\_hooks.html#store\_order\_recalculate\_end

Here you can add an adjustment to the order depending on which payment method has been selected (and this would run right before the payment is submitted to the payment gateway, so as long as you tell your customers you will be adding a surcharge so that they expect the higher amount on their credit card statement).

---
Tags: expresso-store
---


title: Expresso Store: Order items by channel?

text:
# Question
Title: Expresso Store: Order items by channel?
I have a channel for each product type, e.g. breakfast, snacks, starters. When viewing the order using the {checkout} tag and the {items} variable, how can I order by channel?

Thanks for any ideas. Lee

# Answer
It's not possible to change the order of the `{items}` loop in the checkout tag.

If you need to do this, the best method would be to use the native `{exp:query}` tag to find all items for a particular order, and sort them by the channel (or whatever else you want).
> 1 votes

---
Tags: expresso-store
---


# Question
Title: Orders tag error: order_status parameter
I've just updated to Store 2.0.4 and have come across the following error on a page using the orders tag with "order\_status" parameter:

```
Error Number: 1054

Unknown column 'order_status' in 'where clause'

select * from `exp_store_orders` where `site_id` = '1' and `order_completed_date` > 0 and `order_status` = 'new' and `member_id` = '1' order by `id` asc limit 100 offset 0

Filename: third_party/store/src/Store/Illuminate/CodeIgniterConnection.php

Line Number: 100

```

My orders tag looks like this:

```
{exp:store:orders member_id="CURRENT_USER" order_status="new" secure="yes"}

```

Has the parameter name changed in 2.0.4, or is this a bug? The documentation still shows the parameter as "order\_status".

https://exp-resso.com/docs/orders\_tag.html

Many thanks for any help.

# Answer
This looks like a bug in Store and will be fixed in the next version.

In the meantime, if you need a fix you can open `third_party/store/src/Store/Module.php` and around line 773 look for this:

```
$this->queryAndOrParam($query, 'order_status', ee()->TMPL->fetch_param('order_status'));

```

Change it to this:

```
$this->queryAndOrParam($query, 'order_status_name', ee()->TMPL->fetch_param('order_status'));

```

That should do it!
> 2 votes

---
Tags: expresso-store, error, database-error
---


# Question
Title: Closing relationship tag displays when no relationship found
I have the following code in my template, which displays articles that have been tagged as 'related' through a relationship to the current article being viewed:

```
{exp:channel:entries channel="blog_entries" require_entry="yes" url_title="{segment_3}"}
{related_articles}

   {if related_articles:count == 1}
      <div  id="related-articles" class="row">
         <div class="container">
            <div class="col span-12"><h3>Related Articles</h3></div>
   {/if}

   <div class="col span-4">
      <h4><a href="/blog/article/{related_articles:url_title}">{related_articles:title}</a></h4>
   </div>

   {if related_articles:count == related_articles:total_count}
      </div>
      </div>
   {/if}

{/related_articles}
{/exp:channel:entries}

```

This works fine for articles that have a relationship set up. My problem is that on articles that do not have any related articles set up via a relationship, the closing {/related\_articles} tag is displayed in the page render. What am I doing wrong here?

EDIT: Here are some screenshots indicating the results I am getting.

Here is a test blog post that has a related article: https://i.stack.imgur.com/HTz35.png

And here is a test blog post that does not have a related article: https://i.stack.imgur.com/QRkv0.png

# Answer
Are you sure your last conditional shouldn't be {if related\_articles:count == related\_articles:total\_results}? I can't find mention of what the count and other related variables would be for the relationship field, so I suspect it falls back to the same variable set as the entries loop, in which case total\_results would be what you would want here.

Alternatively, I would suggest eliminating all but the title between the {related\_articles}{/related\_articles} tags just to see if the issue persists and then build it back up. If I had to guess, it may be something off with your conditional (such as what I mentioned above) and that then may in turn prevent the rest of the loop from rendering as expected.

Just to confirm - is related\_articles a field in your blog field group?
> 1 votes

# Answer
It looks like the way you've structured your html would easily allow for moving the opening and closing html *outside* of your Playa loop. Then by wrapping everything in just one conditional to check for relationships you can simplify and eliminate the need to conditionally output html.

Try this instead:

```
{exp:channel:entries channel="blog_entries" require_entry="yes" url_title="{segment_3}"}

  {if related_articles}
     <div  id="related-articles" class="row">
        <div class="container">
           <div class="col span-12"><h3>Related Articles</h3></div>
              {related_articles}
                 <div class="col span-4">
                    <h4><a href="/blog/article/{related_articles:url_title}">{related_articles:title}</a></h4>
                 </div>
              {/related_articles}
        </div>
     </div>
  {/if}

{/exp:channel:entries}

```
> 0 votes

---
Tags: channel-entries, relationships
---


# Question
Title: CE Cache or Solspace Static Page Caching: One Faster than the Other?
I've been developing CMS and now EE websites for so long I forget how fast a static website it. Had to save a CMS website as static earlier. Speeds went from approx. 200 to 300ms to 30ms.

My own site I get approx. 150ms speeds with EE caching.

I installed CE Cache and now get approx. 50 to 100ms speeds, so it does help.

My own site as a static site is approx. 30ms.

Speed is extremely important! So important I am wondering whether to ditch EE and go for static. But I am not giving up! Surely there are ways to make a EE site comparable to static.

I then found Solspace's "Static Page Caching". I have not tried this as I have to purchase it and already just purchased CE Cache.

So... I wondered if anyone has any experience with the two, if one is faster than the other?

# Answer
I have run into this issue before and I was in the same boat. And "Static Page Caching" didn't do it for me, CE Cache did. I learned that I had to make sure I was really caching the site correctly, such as the right areas and embeds. Also I made sure that I wrote my markup in the best way I could to reduce queries.

I hope this helps, I have always found that before I even start to cache any page, I really make sure my markup reduces the amount of queries.
> 4 votes

---
Tags: cache, ce-cache
---


# Question
Title: File structure for a staging site is different from production
On my current project the production site has the following folder structure:

```
--system
--config
--public_html
  -assets
  -index.php
  -admin.php
  -etc.

```

But, the staging site I need to create is different:

```
--system
--config
--public_html
  |
  |staging_subdirectory
    -index.php
    -admin.php
    -etc.

```

Both sites will have the system folder above web root and use focuslab's config setup.

Git workflow is also involved, so my best guess is to create a "staging" branch with the specific folder structure and only push to staging from that branch.

I know I can use a subdomain, but who would I set the $system\_path variable located in the index.php and admin.php? Is staging overrides the way to go?

Any ideas?

# Answer
I recently had this same issue. I resolved this way.

I pointed my staging domain to: | staging\_subdirectory / public\_html

And file structure looked like this:

```
--system
--config
--public_html
  |
  |staging_subdirectory
    -system
    -config
    -public_html
        -index.php
        -admin.php
        -etc.

```

I deployed production to `/` and staging to `/public_html/staging_subdirectory/`
> 2 votes

---
Tags: config, focus-lab-master-config, config-overrides, staging-server
---


# Question
Title: Problem with placeholder value and searching on categories (ignoring keywords) - SuperSearch
I need the user to be able to search against two category groups: one for states, and the other for job type, i.e., accounting, HR, etc.

Two problems:

First, I try to use a placeholder value for my fields:

```
<select name="category[]">
<option val="">Select Category</option>
{exp:channel:categories channel="jobs"
category_group="5" disable="category_fields"
style="linear"}
    {exp:super_search:variables}
        <option val="{category_url_title}">{category_name}</option>
    {/exp:super_search:variables}
{/exp:channel:categories}

```

(This is one of them.) The blank value ends up passing 'Select+Category' in to the URL.

Secondly, I need to ignore the keywords field altogether. I tried adding a hidden field:

```
<input type="hidden" name="keywords" value="">

```

But that doesn't matter.

My search results page is yielding incorrect results because it thinks the keywords value is "", which is like "any".

Try submitting the form: http://usesi.savagedevserver.com/jobs

# Answer
For the first issue try changing `<option val="">Select Category</option>` to `<option>Select Category</option>`... specifically removing the `val=""`.

---

I took a look at the **Solspace Supersearch docs** and I don't see that keyword is required. So try taking it out.
> 3 votes

# Answer
Now that you have the search form looking better, try looking at your search results tag. Specifically,

> **category\[\]** This field allows users to search on categories. Default behaviour is searching on category names. To switch this to category ID or URL titles, use the category\_indicator parameter in the Results tag

Do you have the category\_indicator parameter setup on your results tag?
> 1 votes

---
Tags: solspace, supersearch
---


title: Scan uploaded files for viruses

text:
# Question
Title: Scan uploaded files for viruses
Is there anyway to scan uploaded files for viruses? Or is there a solution to scan files on the server? If not, this would be an awesome add-on, if someone were to create it.

# Answer
> 3 votes
On my servers I use Clam AntiVirus. It is free, have good db and has *clamscan* which can be used with system commands.

Based on pass/fail indication which *clamscan* is return, make decision - keep it or delete it.

---
Tags: file-uploads, secure
---


title: Validation errors not displaying

text:
# Question
Title: Validation errors not displaying
I'm not sure what I've done wrong here but with this code, I don't get any validation taking place, it goes straight to the next step:

```
{exp:store:checkout
    next="checkout/payment"
    error_handling="inline"
    require="shipping_name|shipping_address1|shipping_city|shipping_postcode|shipping_country"
    error_delimiters='<label class="error">|</label>'
}

    <section>

        <h1>1. Shipping</h1>

        <div class="fr {if error:shipping_name}error{/if}">
            <label class="fl" for="shipping_name">Name <span class="required">*</span></label>
            <div class="ff">
                {field:shipping_name} {error:shipping_name}
            </div>
        </div>

    </section>

{/exp:store:checkout}

```

If I change the require parameter to remove the shipping\_ from each field, the form reloads the current page, but no errors are output, so I'm a little stumped at this stage.

Any suggestions?

# Answer
There is probably another error which isn't displaying.

Try removing `error_handling="inline"` from your checkout tag to see any errors which you may not have added inline error variables for in your template.
> 0 votes

# Answer
I have validation working perfectly on Store v2.0.3. Here is my code:
**http://pastie.org/private/qs9a9hhzfndkbhk8bsr4g**

Try popping it into your template... Just change the `next="checkout/step2"` parameter to your correct template name.
> 1 votes

---
Tags: expresso-store
---


# Question
Title: Expresso Store Error Handling not Working
I am building my first Expresso Store and having some trouble making fields required. Here is what my checkout form looks like. Note all the fields that that I have marked as required. When I submit the form, it validates the order\_email and displays the error message inline. When I fill out the email field and hit submit, none of the other fields are validated.

I'm on EE 2.6.1 and Store 1.6.4.

Thanks in advance for any help.

# Answer
Generally if there are no errors displaying, but the form is submitting, it's because there are some other validation errors which you don't have inline errors in your template for.

Try removing `error_handling="inline"` from your tag, then resubmit the form and see which errors display.
> 1 votes

---
Tags: expresso-store
---


# Question
Title: Store: How to write a custom payment method using merchant library
Its several days that i'm trying to solve a payment method problem, and I really need support to solve it.

I have to create a new payment method, i studied the existing ones, i tried to simulate the paypall express, but it is still hard for me to understand the flow beetween purchase and purchase\_return method.

This is the problem: I have to create a new payment method that redirect the user in a bank page. Here, the user will insert his bank datas (like paypall) and later, the system redirect the user back to my site. Here i have to do some operations with some informations that the bank give back to me in a GET way.

1 - complete checkout DONE 2 - create a new payment method DONE 3 - connect to a bank DONE (using the "purchase" function) -\> the user is redirected to the bank page. The customer insert his datas, and after the bank redirect my to a url of my site that i told it before in a request. It is like:

```
https://www.mysite.com/checkout/complete/ddf4692dbe3ffc47b8605bf226ab9c1c?PaymentID=1176193011631910&tranid=7549221021631910&TrackID=00021551DD695185B0A5.93845334&postdate=0710&resultcode=CAPTURED&auth=999999&Error=&ErrorText=&cardtype=VISA&payinst=CC&liability=Y&responsecode=00

```

so, the hash\_code and some parameters that the bank append to my return\_url, because i need thosevdatas in order to make more operations later.

4 - Redirection from the bank to my site at the url above DONE

now, if I'm correct, i expect the code inside the function "purchase\_return" will be automatically executed (if i understand right). But it doesn't. I force the call of this function from the template of the checkout/complete page, importing the merchant library and my custom payment method code. Now the code that i put inside the "purchase\_return" function will run. I return new Merchant\_response(Merchant\_response::COMPLETE, NULL, $order\_id);

RESULTS: **The order is still pending. It's not paid and it isn't complete. So: my cart is not empty, too!**

Somebody can help me, please??? thanks on advance!!

# Answer
You don't need to import the merchant library or call `purchase_return()` manually.

If you pass the correct `return_url` to the gateway during the `purchase()` request, then Store will handle the response and call the code inside your `purchase_return()` method for you.

For example, in the Auth.net gateway, the purchase method looks like this:

```
$request = array();
// ...
$request['x_relay_url'] = $this->param('return_url');
$request['x_cancel_url'] = $this->param('cancel_url');

```
> 1 votes

---
Tags: expresso-store, add-on, payment-gateway, commerce
---


# Question
Title: USPS zip code error for International orders - using STORE
Working with a client on a site using Store and having some shipping issues. They sell books and ship them all over the world.

Default shipping is set to: Shipping Address same as Billing We require all folks to have an account in order to buy. We have all countries enabled in the Store settings. USPS is installed as our shipping method with just one option - Priority. They have an active API.

**Shipping error we're receiving:** Please enter a valid ZIP Code for the recipient.

This happens when a customer in a country other than the US tries to check out. For instance, Taiwan has a region with a zip of 403.

I am passing the shipping method on this page as a hidden field.

Am I missing something here? Why would the API reject a zip code unless its US only? Assuming that the API is the issue and not my settings. Any help here would be greatly appreciated!!!

Thanks, Danielle

**Cart/Checkout Page 1**

```
<div id="cart-contents">
    {exp:store:checkout error_handling="inline" error_delimiters='<span class="help-inline">|</span>' next="bookstore/checkout-test"}
    {if no_items}
        <hr>
        <h2 style="text-align:center">Your cart is empty!</h2>
        <hr>
        <h4 style="text-align:center">Browse a Category to Get Started</h4>
        {embed="bookstore/.cart-categories"}
    {/if}
    <input type="hidden" name="shipping_method" value="3" />
    {error:shipping_method}
    <table class="cart">
    <thead>
    <tr>
        <th style="width:70%">Product</th>
        <th style="width:10%;text-align:center">Price</th>
        <th style="width:10%;text-align:center">Qty</th>
        <th style="width:10%;text-align:center">Total</th>
    </tr>
    </thead>
    <tbody>
    {items}
    <tr>
    <td>
        <p><strong><a href="{page_url}">{title}</a></strong></p>
        <p><small>
        <b>SKU:</b> {sku}<br />
        {modifiers}
            <b>{modifier_name}</b>: {modifier_value} {if price_mod_val}({price_mod}){/if}<br />
        {/modifiers}
        </small></p>
    </td>
    <td style="width:10%;text-align:center"><p>{price}</p></td>
    <td style="width:10%;text-align:center"><input name="items[{key}][item_qty]" value="{item_qty}" class="qty" /></td>
    <td style="width:10%;text-align:center"><p>{item_subtotal}</p></td>
    </tr>
    {/items}
    </tbody>
    </table>
    <div class="totals">
        <h3 style="margin:10px 0; padding:0">Your Order Subtotal: {order_subtotal}</h3>
        {if promo_code}<h4>Discount: -{order_discount}</h4>{/if}
        <p class="small">All shippable products delivered via USPS.<br />Shipping cost provided during checkout.</p>
    </div>
    <div class="promo">
        <h4>Have a coupon or promo code?</h4>
        <p><input type="text" name="promo_code" value="{promo_code}" class="input" /> <input type="submit" name="update_cart" value="Apply" class="btn apply" /></p>
        {if promo_code}
            <div class="clearing"> </div>
            <p>Discount {promo_code} has been applied to your order.<br />
            Click here to remove this discount: <input type="submit" name="remove_promo_code" value="X" class="remove" /></p>
        {/if}
    </div>
    <div class="clearing"> </div>
    <hr class="ten"><br />
    <div class="form-actions">
        <input type="submit" name="update_cart" value="Update Totals" class="btn" />
        <input type="submit" name="empty_cart" value="Empty Cart" class="btn btn-danger" />
        {if logged_in}<input type="submit" name="next" value="Continue to Checkout" class="btn btn-primary" />
        {if:else}<a href="{path=bookstore/login}" class="btn btn-primary">Continue to Checkout</a>{/if}
    </div>
    {/exp:store:checkout}

```

**Checkout Page 2**

```
<div id="cart-contents" class="clearfix">
{exp:store:checkout
form_class="form-horizontal"
next="bookstore/checkout-review-test"
error_handling="inline"
error_delimiters='<span class="help-inline">|</span>'
require="name|address1|address3|country"
}
{if no_items}
{redirect="bookstore/cart"}
{/if}
<div class="column">
<fieldset id="billing_details">
<h3>Billing Details</h3>
<p>Please provide your billing info below.</p>
<div class="control-group {if error:billing_name}error{/if}">
    <label class="control-label" for="billing_name">Name</label>
    <div class="controls">
        {field:billing_name} {error:billing_name}
    </div>
</div>
<div class="control-group {if error:billing_address1}error{/if}">
    <label class="control-label" for="billing_address1">Address</label>
    <div class="controls">
        {field:billing_address1} {error:billing_address1}
    </div>
</div>
<div class="control-group {if error:billing_address2}error{/if}">
    <div class="controls">
        {field:billing_address2} {error:billing_address2}
    </div>
</div>
<div class="control-group {if error:billing_address3}error{/if}">
    <label class="control-label" for="billing_address3">City</label>
    <div class="controls">
        {field:billing_address3} {error:billing_address3}
    </div>
</div>
<div class="control-group {if error:billing_region}error{/if}">
    <label class="control-label" for="billing_region">State/Providence/Region</label>
    <div class="controls">
        <input id="billing_region" name="billing_region" type="text" />
        {error:billing_region}
    </div>
</div>
<div class="control-group {if error:billing_postcode}error{/if}">
    <label class="control-label" for="billing_postcode">Zip Code</label>
    <div class="controls">
        {field:billing_postcode} {error:billing_postcode}
    </div>
</div>
<div class="control-group {if error:billing_country}error{/if}">
    <label class="control-label" for="billing_country">Country</label>
    <div class="controls">
        {field:billing_country} {error:billing_country}
    </div>
</div>
</fieldset>
</div>
<div class="column">
<fieldset>
<h3>Shipping Details</h3>
<div class="control-group">
<div class="controls">
    <p><label for="shipping_same_as_billing" class="checkbox">
        {field:shipping_same_as_billing} Same as Billing Details (uncheck to update)
    </label></p>
</div>
</div>
<div id="shipping_details_drawer">
<div class="control-group {if error:shipping_name}error{/if}">
    <label class="control-label" for="shipping_name">Name</label>
    <div class="controls">
        {field:shipping_name} {error:shipping_name}
    </div>
</div>
<div class="control-group {if error:shipping_address1}error{/if}">
    <label class="control-label" for="shipping_address1">Address</label>
    <div class="controls">
        {field:shipping_address1} {error:shipping_address1}
    </div>
</div>
<div class="control-group {if error:shipping_address2}error{/if}">
    <div class="controls">
        {field:shipping_address2} {error:shipping_address2}
    </div>
</div>
<div class="control-group {if error:shipping_address3}error{/if}">
    <label class="control-label" for="shipping_address3">City</label>
    <div class="controls">
        {field:shipping_address3} {error:shipping_address3}
    </div>
</div>
<div class="control-group {if error:shipping_region}error{/if}">
    <label class="control-label" for="shipping_region">State/Providence/Region</label>
    <div class="controls">
        <input id="shipping_region" name="shipping_region" type="text" />
        {error:shipping_region}
    </div>
</div>
<div class="control-group {if error:shipping_postcode}error{/if}">
    <label class="control-label" for="shipping_postcode">Zip Code</label>
    <div class="controls">
        {field:shipping_postcode} {error:shipping_postcode}
    </div>
</div>
<div class="control-group {if error:shipping_country}error{/if}">
    <label class="control-label" for="shipping_country">Country</label>
    <div class="controls">
        {field:shipping_country} {error:shipping_country}
    </div>
</div>
</div>
</fieldset>
</div>
<div class="clearing"> </div>
<div class="form-actions clearfix">
<a href="{path='bookstore/cart-test'}" class="btn" style="float:left">Edit Your Cart</a>
<input type="submit" name="next" value="Review Order" class="btn btn-primary" />
</div>
{/exp:store:checkout}
</div>

```

**Checkout Page 3 / Final**

```
<div id="cart-contents" class="checkout">
{exp:store:checkout
form_class="form-horizontal"
return="bookstore/order/ORDER_HASH"
error_handling="inline"
error_delimiters='<span class="help-inline">|</span>'
form_id="checkout-review"
payment_method="stripe"
}
{if no_items}
{redirect="bookstore/cart"}
{/if}
<div class="stripeErrors" style="padding:10px; background:#FDFFE0; margin:0 0 20px; text-align:center; display:none">
<h4>Payment Error:</h4>
</div>

{if error:payment_method}
<div style="padding:10px; background:#FDFFE0; margin:0 0 20px; text-align:center">
<h4>Order Error:</h4>
<div class="alert alert-error">{error:payment_method}</div>
</div>
{/if}
{if error:shipping_method}
<div style="padding:10px; background:#FDFFE0; margin:0 0 20px; text-align:center">
<h4>Order Error:</h4>
<div class="alert alert-error">{error:shipping_method}</div>
</div>
{/if}
<!-- Address Info -->
<div class="checkOne">
<h3>Billing Details</h3>
<div class="control-group">
    <div><b>{billing_name}</b></div>
    <div>{billing_address1}</div>
    <div>{billing_address2}</div>
    <div>{billing_address3}</div>
    <div>{billing_region_name} {billing_postcode}</div>
    <div>{billing_country_name}</div>
    <!-- <div>{billing_phone}</div> -->
    <div>{order_email}</div>
</div>
<p> </p>
<h3>Shipping Details</h3>
<div class="control-group">
{if shipping_same_as_billing}
    Same as Billing Details
{if:else}
    <div><b>{shipping_name}</b></div>
    <div>{shipping_address1}</div>
    <div>{shipping_address2}</div>
    <div>{shipping_address3}</div>
    <div>{shipping_region_name} {shipping_postcode}</div>
    <div>{shipping_country_name}</div>
    <!-- <div>{shipping_phone}</div> -->
{/if}
</div>
<p> </p>
<p><a href="{path='bookstore/checkout-test'}" class="btn" style="float:left">Edit Address Info</a></p>
</div>

<!-- Payment & Shipping Info -->
<div class="checkTwo">
<h3>Payments Accepted</h3>
<p><img src="/assets/images/img-creditcards.jpg" alt="Credit Cards Accepted" /></p>

<input type="hidden" id="payment_token" name="payment[token]" value="" />

<div class="control-group">
    <label class="control-label" for="payment_name">Name on the Card</label>
    <div class="controls">
        <input type="text" id="payment_name" value="" class="required" />
    </div>
    {if error:payment_name}<label class="error">Provide the name that appears on the card.</label>{/if}
</div>
<div class="control-group">
    <label class="control-label" for="payment_card_no">Credit Card Number</label>
    <div class="controls">
        <input type="text" id="payment_card_no" value="" class="required" />
    </div>
    {if error:payment_card_no}<label class="error">Provide a valid card number.</label>{/if}
</div>
<div class="control-group">
    <label class="control-label" for="payment_exp_month">Expiration Date</label>
    <div class="controls">
        <select id="payment_exp_month" style="width:100px;padding:0" class="required selects">
            <option value="">Month</option>
            {exp_month_options}
        </select>
        <select id="payment_exp_year" style="width:100px;padding:0" class="required selects">
            <option value="">Year</option>
            {exp_year_options}
        </select>
    </div>
    {if error:payment_exp_month}<label class="error" style="display:inline">Choose a month.</label>{/if} {if error:payment_exp_year}<label class="error" style="display:inline">Choose a year.</label>{/if}
</div>
<div class="control-group">
    <label class="control-label" for="payment_csc">Security Code</label>
    <div class="controls">
        <input type="text" id="payment_card_csc" value="" class="required" />
    </div>
    {if error:payment_csc}<label class="error">Provide a valid code.</label>{/if}
</div>
</div>

<!-- Cart Contents -->
<div class="checkThree">
<div class="cartReview">
    <h3>Cart Contents</h3>
    {items}
    <hr class="ten">
    <p><strong>{title}</strong></p>
    <p><small><b>SKU:</b> {sku}<br />{modifiers}<b>{modifier_name}</b>: {modifier_value} {if price_mod_val}({price_mod}){/if}<br />{/modifiers}{item_qty} @ {price} = {item_subtotal}</small></p>
    {/items}
</div>

<h4>Subtotal: {order_subtotal}</h4>
<h4>Order Tax: {order_subtotal_tax}</h4>
<h4>USPS Shipping: {order_shipping}</h4>
{if promo_code}<h4>Discount: -{order_discount}</h4>{/if}
<h3>Grand Total: {order_total}</h3>
</div>

<div class="clearing"> </div>
<p> </p>
<hr class="ten">
<div class="form-actions">
<input type="submit" name="submit" id="checkout_submit" value="Complete Order" class="btn btn-primary" />
</div>
<p> </p><p> </p>
{/exp:store:checkout}
</div>

```

# Answer
The Store USPS shipping extension only supports domestic (US) shipping rates for now. This is because USPS have a complete separate API for rating international shipments.

We're looking at adding support for international rates in a future version, but there is no plan/release date for when this may happen yet.
> 2 votes

---
Tags: expresso-store
---


# Question
Title: Store - PHP Error was encountered when tried to export order details in store
Good day,

An error was encountered when I was trying to export order details to PDF in Store Module.

Following are the errors:

```
A PHP Error was encountered:
Severity: Warning ;
Message: Illegal string offset 'hex';
Filename: include/style.cls.php ;
Line Number: 1418;

Unable to stream pdf: headers already sent

```

Version of EE and Store are 2.6.1 and 1.64 respectively.

# Answer
> 1 votes
This was a bug in the PDF generation library Store uses (dompdf). It only happened on servers running PHP 5.4 or newer.

This has been fixed in Store 1.6.5:

https://exp-resso.com/docs/release\_notes.html#store\_165

---
Tags: expresso-store, php, expresso
---


# Question
Title: Packing Slip data not sent with Paypal Payments Pro Gateway in Expresso Store
we're using EE 2.6.1 and Store 1.6.4, and are utilizing the Paypal Pro payment method. We got things working mostly, however there are some issues with the data as we see it within Paypal, so I'm thinking the data isn't getting passed to Paypal correctly or completely.

The first issue I noticed was after I submitted an order, in PayPal when I viewed the details of the order, it would have something like "Order #242" as the "Item Title". This wasn't very useful for me. It would be ideal if this could list all of the individual items and their quantities, but I'm not sure how to get it to do that. I did modify the payment gateway to list the individual items and quantities in this "Item title" section... so that kinda works.

The remaining issue is with the Packing Slip in Paypal. When I view the packing slip for the order in paypal, for "Address" it says "No Address Provided"... not showing the buyers address. That is crucial! Also, it doesn't list each individual item, but instead lists Qty: 1, Website: (our website url), Item Number: n/a, Description: (Buyer Name), Amount: (total amount). Then it lists $0.00 for shipping and handling and $0.00 for Sales Tax.

Is anyone else having this issue? Am I doing something wrong, or is this Paypal Pro payment gateway just really not fully fleshed out?

Thanks!

Gary

# Answer
UPDATE: As of Store 2.1, PayPal Express supports passing line item details via PayPal Express. I believe this won't work with PayPal Pro yet though, as the syntax is slightly different.

ORIGINAL: Store doesn't pass individual line item prices through to PayPal. This is a feature request we are working on, but for now "Order #242" is all you will see in Paypal, and you will need to look in the Store control panel for the full order details.

Likewise, the shipping address is not currently passed through either. It's probably easier if you print your packing slips from your EE control panel instead of Paypal.
> 4 votes

---
Tags: expresso-store, ee2, paypal
---


# Question
Title: Expresso Store: Inventory not showing in CP menu for client's member group
I'm having the same problem as this post, only the accepted answer doesn't work for me.

Sorry for re-posting the question, but I didn't if I can carry on a "me too" conversation in the answer thread?

When setting up a client's Member Group, I can't get *Inventory* to appear in the **Store** menu. I even duplicated the Super Admin's Member Group with all its privileges, but yet still couldn't get this to work. It seems that only {group\_id==1} is able to see the Inventory tab.

This is an MSM site and even with the client's member group having access to all store-related channels in all sites, it's still a no-go...

EE 2.6.1, Store 1.6.4

# Answer
To access the inventory tab in Store, a customer must have permission to edit/create entries in your products channel.

Make sure you have set up a products channel for this site, and then make sure that the member group can create entries under Content \> Publish. If that is possible but you still don't see the Inventory menu item, send an email to support@exp-resso.com and we will investigate.
> 1 votes

---
Tags: expresso-store, control-panel
---


title: Cancel while on WorldPay

text:
# Question
Title: Cancel while on WorldPay
I currently have Store (1.6.4) up and running amazingly. However, I've just spotted that if a user clicks cancel while on worldpay then I get a callback failure alert:

```
Error reported: Callback to https://capuk.org/?ACT=35&H=8ea9360d3687aa3ae10091b4fa2be74c: NOT OK, recevied HTTP status: 302
Server Reference: mg4imsps3p:callbackFailureEmail-122700:MerchReq-870-97

```

Any help would be great.

Thanks, Dan

# Answer
> 1 votes
This sounds like a bug. It's probably best if you email support@exp-resso.com so we can investigate this directly on your website.

---
Tags: expresso-store
---


# Question
Title: How do you separate Handling charge from shipping?
We'd like to use the default handling charge as part of Store but in a different way. We are adding a handling charge to each item but we want it to be separate from shipping and also allow us to rename it on the front end from Handling to whatever we'd like. The handling charge is actually a Ticketing Fee and on our end having it show up as handling charge is fine we just would like it separate from Shipping and still show shipping as $0 on the front end since we don't ship some products.

# Answer
In the Store checkout tag there is an `{order_handling}` variable which will display the handling total.

There is also `{order_shipping_ex_handling}` if you want to display the shipping amount excluding handling.

Both of these can be combined with `_inc_tax` to display the tax inclusive price: `{order_handling_inc_tax}`, or `_val` to display the unformatted number: `{order_handling_val}`.
> 1 votes

---
Tags: expresso-store
---


# Question
Title: User registration and profile changes do not work on site with Expresso Store
I'm working on a site that uses Expresso Store for e-commerce. The store itself seems to work fine, however there are templates that use exp:user to register and update a user's profile that are not working as intended - upon submitting the register or update form, the page redirects to a blank page and does not register the user or update profiles of existing users. It seems at this point to be some conflict with Expresso Store, but I'm not sure where...

The site uses an SSL certificate for all sections, and both register and edit profile forms have secure\_action="yes".

Expression Engine build is 2.5.5, Store is 1.6.4, and User is 3.3.9. Any help would be greatly appreciated!

Edit: The .htaccess file:

## Solspace Static Page Caching: Site #1

```
RewriteEngine On
RewriteBase //www.vandykblueberries.ca/

```

## RULE #1 - gzip

```
## Accepts GZ output
RewriteCond %{HTTP:Accept-Encoding} gzip

## Ignore POST requests
RewriteCond %{REQUEST_METHOD} !=POST

## Ignore EE Query requests
RewriteCond %{QUERY_STRING} !^(css|ACT)

## Override Cookie That Disables Caching
RewriteCond %{HTTP:Cookie} !^.*(static_page_caching_override).*$

## Override Segment for ToolBar
RewriteCond $1 !spc_override/*$

## Remove the index.php from the next conditional check, neutralize slashes
RewriteCond $1 ^(index.php/)*(.*)(/*)$

## Cache File Exists?
RewriteCond /home/vandykbl/www/manage/expressionengine/cache/1/$2/index.html.gz -f

## Redirect to Cache File
RewriteRule ^(index.php/*)*(.*)(/*) //www.vandykblueberries.ca/cache/1/$2/index.html.gz [L]

```

## RULE #2 - normal

```
## Ignore POST requests
RewriteCond %{REQUEST_METHOD} !=POST

## Ignore EE Query requests
RewriteCond %{QUERY_STRING} !^(css|ACT)

## Override Cookie That Disables Caching
RewriteCond %{HTTP:Cookie} !^.*(static_page_caching_override).*$

## Override Segment for ToolBar
RewriteCond $1 !spc_override/*$

## Remove the index.php from the next conditional check, neutralize slashes
RewriteCond $1 ^(index.php/)*(.*)(/*)$

## Cache File Exists?
RewriteCond /home/vandykbl/www/manage/expressionengine/cache/1/$2/index.html -f

## Redirect to Cache File
RewriteRule ^(index.php/*)*(.*)(/*) //www.vandykblueberries.ca/cache/1/$2/index.html [L]

```

## RULE #3 - Remove SPC Override Segment from URI

```
RewriteRule ^(.+)/spc_override$ //www.vandykblueberries.ca/$1 [L]

```

## END Solspace Static Page Caching: Site #1

RewriteEngine On

```
    # Removes index.php from ExpressionEngine URLs
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?/$1 [L]

```

# Answer
I'm not sure why Store would be at fault here. It sounds like a problem with the register/update forms in Solspace User.

The first step I would take to debug is to uninstall Store (back up your data first!), and see whether you can get the User forms working on their own.
> 1 votes

---
Tags: expresso-store, users
---


title: Expresso-store sagepay errors

text:
# Question
Title: Expresso-store sagepay errors
Using sagepay\_server gateway in test mode can get to payment page fine but on submit I get sagepay errors:

```
HTTP Status Code: 500
HTTP Status Message: The request was unsuccessful due to an unexpected condition encountered by the server.
Error Code : 5006
Error Description : Unable to redirect to Vendor's web site. The Vendor failed to provide a RedirectionURL.

```

Return URL is in place in the checkout tag, using return="shop/order/ORDER\_HASH" which usually works fine.

Settings for clients sagepay account are correct.

# Answer
This sounds like a bug - probably best if you email support@exp-resso.com so we can investigate it directly on your server.
> 0 votes

---
Tags: expresso-store, expresso, server, sagepay
---


# Question
Title: More products then available being purchased
We figured out that we have had an issue the last few weeks where products are being ordered beyond the qty available. I was able to replicate how it was done and want to know if there is a fix.

We have our product that has 2 available total. The product has a single SKU product modifier of size. People have the ability of over ordering the product if they add different sizes to their cart. For instance if their is 2 packages left and they add 2 smalls, they can go back and then add 2 more mediums to their cart and checkout. When looking at the backend the qty is now -2 on our end. How can we get this fixed, so far it's been on products that aren't a big deal but we do have some coming up where it would certainly would be a major issue.

# Answer
> 1 votes
This sounds like a bug - probably best if you email support@exp-resso.com so we can diagnose it and help you find a solution.

---
Tags: expresso-store
---


# Question
Title: Expresso Store Inline Errors Not Working
I'm using Expresso Store 1.6.4 and EE 2.6.0. The inline errors are not working, the page just refreshes to the site homepage. If I remove the inline errors, the default EE error page displays correctly.

I'll just mention that we're also using Boldmindeds Publisher on this site as well, which has caused some issues on other parts of the site, so that could be an explanation.

Thanks,

# Answer
This sounds like it is being caused by Publisher. If you disable Publisher, does the problem go away?

If so, it's probably best to contact BoldMinded so they can investigate the issue directly.
> 3 votes

---
Tags: expresso-store
---


title: Expresso Store Order confirmation page

text:
# Question
Title: Expresso Store Order confirmation page
I'm having a slight issue with expresso store, was wondering if anyone can help me out. The problem is on the last step, when they enter the credit card details. I've set the following

return="shop/thank\_you/ORDER\_HASH"

and

secure="yes"

The final page with the order confirmation doesn't display properly as there's extra text in the url.

I should be getting mydomain.com/en/shop/thank\_you/ORDER\_HASH but I'm actually getting

mydomian.com/en/https:/mydomain.comm:443/https:/mydomain.com/shop/thank\_you/ORDER\_HASH

Just to note, the order does complete successfully, it just doesn't display the final page due to the extra details in the URL.

Final Confirmation page code:

```
 <header class="purchase-steps">
  <h6>Step to Purchase</h6>
  <nav> <a href="#" class="">1</a> <a href="#" class="">2</a> <a href="#" class="">3</a> <a href="#" class="">4</a> <a href="#" class="">5</a> <a href="#" class="active last">6</a> </nav>
</header>
      <header class="pageTitle">
  <h3> Thank you for your order! </h3>
</header>
{exp:store:orders order_hash="{segment_3}"}
<h4>Your order ID is: <span class="blue">{order_id}</span></h4>
{/exp:store:orders}
<p>It is currently being processed by our sales team. You will receive an email confirming your details. Please contact us at (01) 123 4567 if you have any queries about this purchase.</p>
<br>
<a href="#" class="more button green">Return to Our Products</a> <br>
<br>

```

ht access file:

```
AddHandler php5-script .php

RewriteEngine on

# remove index.php
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2013 20:00:00 GMT"
</FilesMatch>

Header unset ETag
FileETag None

ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType image/x-icon A2592000

<IfModule mod_rewrite.c>
    #------------------- remove trailing slash -------------------
    RewriteCond %{REQUEST_URI} !^/system [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.+)/$ /$1 [R=301,L,QSA]

    #------------------- CE Cache Static Driver -------------------
    RewriteCond %{REQUEST_URI} !^/system [NC]
    RewriteCond %{QUERY_STRING} !ACT|URL [NC]
    RewriteCond %{REQUEST_METHOD} !=POST [NC]
    RewriteCond %{DOCUMENT_ROOT}/static/ce_cache/0158f6/static%{REQUEST_URI}/index\.html -f [NC]
    RewriteRule (.*) /_static_cache_handler.php%{REQUEST_URI}/index\.html [L,QSA]
</IfModule>

```

Thanks.

# Answer
> 2 votes
Answer provided in comments:

> I'm really not sure what's happening with this, but I've managed to work around it by using EpicVoyages Force SSL plugin to do the switch.

http://devot-ee.com/add-ons/force-ssl

---
Tags: expresso-store
---


# Question
Title: "shipping same as billing" causing address not to be captured
I have setup my checkout templates exactly like the ones in the example templates, yet bizarely when I check the option "shipping same as billing" the system no longer collects address line 1,2 or three or the city.

What could be causing this?

# Answer
If you enable "shipping same as billing", then the shipping address will be overwritten by whatever is in the billing address (and shipping address validations won't fire).

Therefore, if you are using that setting, you need to make sure the customer enters a billing address (otherwise it will copy the empty billing address over top of the shipping address).
> 1 votes

---
Tags: expresso-store
---


title: VZ Buyers Incomplete Issue

text:
# Question
Title: VZ Buyers Incomplete Issue
We have an issue where an incomplete transaction is showing up on VZ Buyers like the person bought the items. However the transaction was incomplete and the transaction failed so it was not taken out of stock but it's still listed. Does anyone have a fix for this?

Our system has to be very precise with us selling 100 items at a time can't have room for buyer error by any means. Any help would be greatly appreciated

# Answer
This sounds like a bug in VZ Buyers. Are you talking about the fieldtype displayed in the CP, or the `{exp:vz_buyers:print_csv}` tag?

A quick glance at the source code looks like it is not restricting the list to only completed orders.

If you open up that file, right around line 48 you will see this:

```
->join('store_orders', 'store_orders.order_id = store_order_items.order_id')

```

After that, add this line:

```
->where('store_orders.order_completed_date >', 0)

```

You might need to make a similar adjustment to the fieldtype file (ft.vz\_buyers.php). Without this change then it will treat incomplete orders (which are still carts) as if they were real orders.
> 2 votes

---
Tags: expresso-store, vz-buyers
---


# Question
Title: Change default_country with ajax as guest?
i want to find a solution to change the default\_country of the store for guest members on the checkout page with ajax. I did an ajax submit to update the choosen country but in guest mode this happened only ones and i didn't know why. When i'm logged in as store member it work like it should.

Thanks

Peter

# Answer
You can set a default country in the Store control panel.

Under Store \> Settings \> Countries / States, simply add a default country and region/state. After you change it, make sure you are logged out and clear your cart, then add an item to your cart and it should pre-select the default country for you automatically.
> 1 votes

---
Tags: expresso-store
---


# Question
Title: Unable to install EE - config.php and database.php not being written
When installing EE - I get the dreaded database connection error. I've verified the DB works with the credentials by connecting locally in mysql with the same info. I've also utilized your dbtest.php and verified it works.

The problem appears to be EE isn't writing config.php and database.php. The files are zero byte after I hit install.

I've verified permissions and ownership on both files, as well as the other files as required by the installation script.

Is there potentially some php or apache config that is required to allow these files to be written? Please let me know. Thank you.

# Answer
> 1 votes
Solution posted in question:

Apparently there is an undocumented bug in EE -

if your database password contains a percent symbol EE will fail to finish installation and configuration, thereby leaving you with a 'unable to connect to database' error on the second screen of install.

---
Tags: php-errors, database-error
---