in all cases where the duty imposed by law shall be regulated by, or directed to be estimated or based upon, the value of the square yard, or of any specified quantity or parcel of such goods, wares, or merchandise